[-] Fixed bug with attacking from transporter

This commit is contained in:
cybermind 2015-02-25 17:52:42 +05:00
parent 5e3426967e
commit 7c28912489

View file

@ -1151,13 +1151,15 @@ CUnit *AttackUnitsInDistance(const CUnit &unit, int range, bool onlyBuildings)
}
return NULL;
} else {
// If unit is removed, use containers x and y
const CUnit *firstContainer = unit.Container ? unit.Container : &unit;
std::vector<CUnit *> table;
if (onlyBuildings) {
SelectAroundUnit(unit, range, table,
SelectAroundUnit(*firstContainer, range, table,
MakeAndPredicate(HasNotSamePlayerAs(Players[PlayerNumNeutral]), IsBuildingType()));
} else {
SelectAroundUnit(unit, range, table,
SelectAroundUnit(*firstContainer, range, table,
MakeNotPredicate(HasSamePlayerAs(Players[PlayerNumNeutral])));
}