[-] Fixed bug with attacking from transporter
This commit is contained in:
parent
5e3426967e
commit
7c28912489
1 changed files with 4 additions and 2 deletions
|
@ -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])));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue