- disallow air units to morph back to land if unwalkable objects or water terrain are below
This commit is contained in:
parent
f897884321
commit
060a9d3fe6
|
@ -315,10 +315,21 @@ bool Map::isFreeCell(const Vec2i &pos, Field field) const {
|
|||
(field!=fLand || getDeepSubmerged(getCell(pos)) == false);
|
||||
}
|
||||
|
||||
bool Map::isFreeCellOrHasUnit(const Vec2i &pos, Field field, const Unit *unit) const{
|
||||
if(isInside(pos)){
|
||||
bool Map::isFreeCellOrHasUnit(const Vec2i &pos, Field field, const Unit *unit) const {
|
||||
if(isInside(pos)) {
|
||||
Cell *c= getCell(pos);
|
||||
if(c->getUnit(unit->getCurrField())==unit){
|
||||
if(c->getUnit(unit->getCurrField()) == unit) {
|
||||
if(unit->getCurrField() == fAir) {
|
||||
const SurfaceCell *sc= getSurfaceCell(toSurfCoords(pos));
|
||||
if(sc != NULL) {
|
||||
if(getDeepSubmerged(sc) == true) {
|
||||
return false;
|
||||
}
|
||||
else if(field == fLand) {
|
||||
return sc->isFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
|
|
Loading…
Reference in New Issue
Block a user