mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Avoid costly std vector construction
This commit is contained in:
parent
9b8145f522
commit
3ac80e1f09
@ -357,7 +357,7 @@ const battle::Unit * CBattleInfoCallback::battleGetUnitByPos(BattleHex pos, bool
|
||||
auto ret = battleGetUnitsIf([=](const battle::Unit * unit)
|
||||
{
|
||||
return !unit->isGhost()
|
||||
&& vstd::contains(battle::Unit::getHexes(unit->getPosition(), unit->doubleWide(), unit->unitSide()), pos)
|
||||
&& unit->coversPos(pos)
|
||||
&& (!onlyAlive || unit->alive());
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user