1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

fix direction

This commit is contained in:
Laserlicht
2025-06-20 03:45:11 +02:00
parent 0cb74bc719
commit eef3e00f42
4 changed files with 11 additions and 9 deletions

View File

@@ -87,16 +87,16 @@ bool MapRendererBaseContext::isActiveHero(const CGObjectInstance * obj) const
return false;
}
std::optional<int3> MapRendererBaseContext::monsterAttacked(const CGObjectInstance * obj) const
int MapRendererBaseContext::monsterAttacked(const CGObjectInstance * obj) const
{
if(obj->ID != Obj::MONSTER)
return std::nullopt;
return -1;
for(auto & battle : GAME->interface()->cb->getActiveBattles())
if(obj->pos == battle.second->getBattle()->getLocation())
return battle.second->getBattle()->getSideHero(BattleSide::ATTACKER)->pos;
return battle.second->getBattle()->getSideHero(BattleSide::ATTACKER)->moveDir;
return std::nullopt;
return -1;
}
bool MapRendererBaseContext::tileAnimated(const int3 & coordinates) const