mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
compile fix, fixes blit order of heroes in siege
This commit is contained in:
@ -3234,11 +3234,6 @@ void CBattleInterface::showBattlefieldObjects(SDL_Surface * to)
|
|||||||
showBattleEffects(to, hex.effects);
|
showBattleEffects(to, hex.effects);
|
||||||
};
|
};
|
||||||
|
|
||||||
if(attackingHero)
|
|
||||||
attackingHero->show(to);
|
|
||||||
if(defendingHero)
|
|
||||||
defendingHero->show(to);
|
|
||||||
|
|
||||||
BattleObjectsByHex objects = sortObjectsByHex();
|
BattleObjectsByHex objects = sortObjectsByHex();
|
||||||
|
|
||||||
// dead stacks should be blit first
|
// dead stacks should be blit first
|
||||||
@ -3249,6 +3244,13 @@ void CBattleInterface::showBattlefieldObjects(SDL_Surface * to)
|
|||||||
|
|
||||||
// display objects that must be blit before anything else (e.g. topmost walls)
|
// display objects that must be blit before anything else (e.g. topmost walls)
|
||||||
showHexEntry(objects.beforeAll);
|
showHexEntry(objects.beforeAll);
|
||||||
|
|
||||||
|
// show heroes after "beforeAll" - e.g. topmost wall in siege
|
||||||
|
if(attackingHero)
|
||||||
|
attackingHero->show(to);
|
||||||
|
if(defendingHero)
|
||||||
|
defendingHero->show(to);
|
||||||
|
|
||||||
// actual blit of most of objects, hex by hex
|
// actual blit of most of objects, hex by hex
|
||||||
// NOTE: row-by-row blitting may be a better approach
|
// NOTE: row-by-row blitting may be a better approach
|
||||||
for( auto & data : objects.hex )
|
for( auto & data : objects.hex )
|
||||||
|
@ -2278,7 +2278,7 @@ si8 CBattleInfoCallback::battleMaxSpellLevel() const
|
|||||||
|
|
||||||
boost::optional<int> CBattleInfoCallback::battleIsFinished() const
|
boost::optional<int> CBattleInfoCallback::battleIsFinished() const
|
||||||
{
|
{
|
||||||
auto &stacks = battleGetAllStacks();
|
auto stacks = battleGetAllStacks();
|
||||||
|
|
||||||
//checking winning condition
|
//checking winning condition
|
||||||
bool hasStack[2]; //hasStack[0] - true if attacker has a living stack; defender similarly
|
bool hasStack[2]; //hasStack[0] - true if attacker has a living stack; defender similarly
|
||||||
|
Reference in New Issue
Block a user