1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Fixed #1055 - hang when creature performed automatic (not controleld by player) action.

Fixed possible crash on arrow turret turn.
This commit is contained in:
Michał W. Urbańczyk
2012-08-27 12:34:43 +00:00
parent 7ce9e95525
commit a14f381d48
5 changed files with 41 additions and 23 deletions

View File

@@ -119,7 +119,7 @@ public:
void endBattle(int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2); //ends battle
void prepareAttack(BattleAttack &bat, const CStack *att, const CStack *def, int distance, int targetHex); //distance - number of hexes travelled before attacking
void applyBattleEffects(BattleAttack &bat, const CStack *att, const CStack *def, int distance, bool secondary); //damage, drain life & fire shield
void checkForBattleEnd( std::vector<CStack*> &stacks );
void checkForBattleEnd();
void setupBattle(int3 tile, const CArmedInstance *armies[2], const CGHeroInstance *heroes[2], bool creatureBank, const CGTownInstance *town);
void setBattleResult(int resultType, int victoriusSide);
@@ -197,6 +197,7 @@ public:
void playerMessage( ui8 player, const std::string &message);
bool makeBattleAction(BattleAction &ba);
bool makeAutomaticAction(const CStack *stack, BattleAction &ba); //used when action is taken by stack without volition of player (eg. unguided catapult attack)
void handleSpellCasting(int spellID, int spellLvl, BattleHex destination, ui8 casterSide, ui8 casterColor, const CGHeroInstance * caster, const CGHeroInstance * secHero,
int usedSpellPower, ECastingMode::ECastingMode mode, const CStack * stack, si32 selectedStack = -1);
bool makeCustomAction(BattleAction &ba);