mirror of
https://github.com/glest/glest-source.git
synced 2025-08-14 12:23:59 +02:00
Now water buildings are supported properly
This commit is contained in:
@@ -772,8 +772,9 @@ namespace Game {
|
||||
isInside(pos) &&
|
||||
isInsideSurface(toSurfCoords(pos)) &&
|
||||
(getCell(pos)->isFree(field) ? true : (buildingsOnly && !getCell(pos)->getUnit(field)->getType()->hasSkillClass(scBeBuilt))) &&
|
||||
(SkillType::toActualField(field) == fAir || getSurfaceCell(toSurfCoords(pos))->isFree()) &&
|
||||
(SkillType::toActualField(field) == fAir || ((field & fWater) == fWater ? ((field & fLand) == fLand ? true : getDeepSubmerged(getCell(pos))) : !getDeepSubmerged(getCell(pos))));
|
||||
(SkillType::toActualField(field) == fAir ||
|
||||
(getSurfaceCell(toSurfCoords(pos))->isFree() &&
|
||||
((field & fWater) == fWater ? ((field & fLand) == fLand ? true : getDeepSubmerged(getCell(pos))) : !getDeepSubmerged(getCell(pos)))));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1064,7 +1064,7 @@ namespace Game {
|
||||
Unit *builtUnit = new Unit(world->getNextUnitId(unit->getFaction()), newpath, buildPos, builtUnitType, unit->getFaction(), world->getMap(), facing);
|
||||
if (toleratePos)
|
||||
builtUnit->setPos(pathFinder->computeNearestFreePos(builtUnit, buildPos, false, true));
|
||||
if (world->getMap()->isFreeCells(builtUnit->getPos(), builtUnit->getType()->getSize(), builtUnit->getCurrField(), true)) {
|
||||
if (world->getMap()->isFreeCells(builtUnit->getPos(), builtUnit->getType()->getSize(), (builtUnit->getCurrField() & fAir) == fAir ? fAir : fLandWater, true)) {
|
||||
if (SystemFlags::getSystemSettingType(SystemFlags::debugUnitCommands).enabled) SystemFlags::OutputDebug(SystemFlags::debugUnitCommands, "In [%s::%s Line: %d]\n", __FILE__, __FUNCTION__, __LINE__);
|
||||
|
||||
builtUnit->create();
|
||||
|
Reference in New Issue
Block a user