mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
CBattleHero::clickRight: more elegant code for side detection
This commit is contained in:
parent
5b0a0d5959
commit
4a302d4fe5
@ -214,11 +214,8 @@ void CBattleHero::clickRight(tribool down, bool previousState)
|
||||
|
||||
if (down && myOwner->myTurn)
|
||||
{
|
||||
if (myHero != nullptr)
|
||||
targetHero.initFromHero(myHero, InfoAboutHero::EInfoLevel::INBATTLE);
|
||||
else
|
||||
targetHero = myOwner->enemyHero();
|
||||
|
||||
auto h = flip ? myOwner->defendingHeroInstance : myOwner->attackingHeroInstance;
|
||||
targetHero.initFromHero(h, InfoAboutHero::EInfoLevel::INBATTLE);
|
||||
GH.pushInt(new CHeroInfoWindow(targetHero, &windowPosition));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user