Skip to content

Commit 0d7fd20

Browse files
committed
don't allow user to scroll while bullet is in flight
1 parent ef7509c commit 0d7fd20

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/Battlescape/ProjectileFlyBState.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "AlienBAIState.h"
3939
#include "Camera.h"
4040
#include "Explosion.h"
41+
#include "BattlescapeState.h"
4142

4243
namespace OpenXcom
4344
{
@@ -58,7 +59,6 @@ ProjectileFlyBState::ProjectileFlyBState(BattlescapeGame *parent, BattleAction a
5859
*/
5960
ProjectileFlyBState::~ProjectileFlyBState()
6061
{
61-
6262
}
6363

6464
/**
@@ -254,7 +254,10 @@ void ProjectileFlyBState::init()
254254
_targetVoxel = Position(_action.target.x*16 + 8, _action.target.y*16 + 8, _action.target.z*24 + 12);
255255
}
256256
}
257-
createNewProjectile();
257+
if(createNewProjectile())
258+
{
259+
_parent->getMap()->setCursorType(CT_NONE);
260+
}
258261
}
259262

260263
/**
@@ -378,7 +381,6 @@ bool ProjectileFlyBState::createNewProjectile()
378381
return false;
379382
}
380383
}
381-
382384
return true;
383385
}
384386

@@ -389,6 +391,8 @@ bool ProjectileFlyBState::createNewProjectile()
389391
*/
390392
void ProjectileFlyBState::think()
391393
{
394+
395+
_parent->getSave()->getBattleState()->clearMouseScrollingState();
392396
/* TODO refactoring : store the projectile in this state, instead of getting it from the map each time? */
393397
if (_parent->getMap()->getProjectile() == 0)
394398
{

0 commit comments

Comments
 (0)