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