Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix more pre-battle fov shenannigans
i swear to god i'm going to pistol whip the next person to encounter one.
- Loading branch information
|
@@ -996,13 +996,13 @@ void BattlescapeState::btnPrevSoldierClick(Action *) |
|
|
* @param setReselect When true, flag the current unit first. |
|
|
* @param checkInventory When true, don't select a unit that has no inventory. |
|
|
*/ |
|
|
void BattlescapeState::selectNextPlayerUnit(bool checkReselect, bool setReselect, bool checkInventory) |
|
|
void BattlescapeState::selectNextPlayerUnit(bool checkReselect, bool setReselect, bool checkInventory, bool checkFOV) |
|
|
{ |
|
|
if (allowButtons()) |
|
|
{ |
|
|
if (_battleGame->getCurrentAction()->type != BA_NONE) return; |
|
|
BattleUnit *unit = _save->selectNextPlayerUnit(checkReselect, setReselect, checkInventory); |
|
|
updateSoldierInfo(); |
|
|
updateSoldierInfo(checkFOV); |
|
|
if (unit) _map->getCamera()->centerOnPosition(unit->getPosition()); |
|
|
_battleGame->cancelCurrentAction(); |
|
|
_battleGame->getCurrentAction()->actor = unit; |
|
@@ -1276,7 +1276,7 @@ bool BattlescapeState::playableUnitSelected() |
|
|
/** |
|
|
* Updates a soldier's name/rank/tu/energy/health/morale. |
|
|
*/ |
|
|
void BattlescapeState::updateSoldierInfo() |
|
|
void BattlescapeState::updateSoldierInfo(bool checkFOV) |
|
|
{ |
|
|
BattleUnit *battleUnit = _save->getSelectedUnit(); |
|
|
|
|
@@ -1371,7 +1371,10 @@ void BattlescapeState::updateSoldierInfo() |
|
|
} |
|
|
} |
|
|
|
|
|
_save->getTileEngine()->calculateFOV(_save->getSelectedUnit()); |
|
|
if (checkFOV) |
|
|
{ |
|
|
_save->getTileEngine()->calculateFOV(_save->getSelectedUnit()); |
|
|
} |
|
|
int j = 0; |
|
|
for (std::vector<BattleUnit*>::iterator i = battleUnit->getVisibleUnits()->begin(); i != battleUnit->getVisibleUnits()->end() && j < VISIBLE_MAX; ++i) |
|
|
{ |
|
|
|
@@ -91,7 +91,7 @@ class BattlescapeState : public State |
|
|
void toggleKneelButton(BattleUnit* unit); |
|
|
public: |
|
|
/// Selects the next soldier. |
|
|
void selectNextPlayerUnit(bool checkReselect = false, bool setReselect = false, bool checkInventory = false); |
|
|
void selectNextPlayerUnit(bool checkReselect = false, bool setReselect = false, bool checkInventory = false, bool checkFOV = true); |
|
|
/// Selects the previous soldier. |
|
|
void selectPreviousPlayerUnit(bool checkReselect = false, bool setReselect = false, bool checkInventory = false); |
|
|
static const int DEFAULT_ANIM_SPEED = 100; |
|
@@ -162,7 +162,7 @@ class BattlescapeState : public State |
|
|
/// Determines whether a playable unit is selected. |
|
|
bool playableUnitSelected(); |
|
|
/// Updates soldier name/rank/tu/energy/health/morale. |
|
|
void updateSoldierInfo(); |
|
|
void updateSoldierInfo(bool checkFOV = true); |
|
|
/// Animates map objects on the map, also smoke,fire, ... |
|
|
void animate(); |
|
|
/// Handles the battle game state. |
|
|
|
@@ -288,7 +288,7 @@ void InventoryState::init() |
|
|
{ |
|
|
if (_parent) |
|
|
{ |
|
|
_parent->selectNextPlayerUnit(false, false, true); |
|
|
_parent->selectNextPlayerUnit(false, false, true, _tu); |
|
|
} |
|
|
else |
|
|
{ |
|
|