diff --git a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 040eb5b7c2c..9feb5b588cf 100644 --- a/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -5396,8 +5396,8 @@ Bool Pathfinder::adjustToLandingDestination(Object *obj, Coord3D *dest) TheTerrainLogic->getMaximumPathfindExtent(&extent); // If the object is off the map & the goal is off the map, it is a scripted setup, so just // go to the dest. - if (!extent.isInRegionNoZ(*dest)) { - if (!extent.isInRegionNoZ(*obj->getPosition())) { + if (!extent.isInRegion(dest->asCoord2D())) { + if (!extent.isInRegion(obj->getPosition()->asCoord2D())) { return true; } } diff --git a/Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index fd9733f25ac..f40eb60bc20 100644 --- a/Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/Core/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -2069,7 +2069,7 @@ bool GameLogic::onPlaceBeacon(MAYBE_UNUSED GameMessage *msg) Coord3D pos = msg->getArgument( 0 )->location; Region3D r; TheTerrainLogic->getExtent(&r); - if (!r.isInRegionNoZ(pos)) + if (!r.isInRegion(pos.asCoord2D())) pos = TheTerrainLogic->findClosestEdgePoint(&pos); const ThingTemplate *thing = TheThingFactory->findTemplate( msgPlayer->getPlayerTemplate()->getBeaconTemplate() ); diff --git a/Core/Libraries/Include/Lib/IRegion2D.h b/Core/Libraries/Include/Lib/IRegion2D.h index aae6ffd2eb3..598c1c42ae0 100644 --- a/Core/Libraries/Include/Lib/IRegion2D.h +++ b/Core/Libraries/Include/Lib/IRegion2D.h @@ -60,5 +60,14 @@ struct IRegion2D Int width() const { return hi.x - lo.x; } Int height() const { return hi.y - lo.y; } + Bool isInRegion( Int x, Int y ) const { return (lo.x < x) && (x < hi.x) && (lo.y < y) && (y < hi.y); } + + Bool isInRegion( const ICoord2D& point ) const { return isInRegion(point.x, point.y); } + + Bool isInRegion( const IRegion2D& other ) const + { + return (lo.x < other.lo.x) && (other.hi.x < hi.x) && + (lo.y < other.lo.y) && (other.hi.y < hi.y); + } }; diff --git a/Core/Libraries/Include/Lib/IRegion3D.h b/Core/Libraries/Include/Lib/IRegion3D.h index ee40b57c8f2..24d95d75f00 100644 --- a/Core/Libraries/Include/Lib/IRegion3D.h +++ b/Core/Libraries/Include/Lib/IRegion3D.h @@ -61,4 +61,26 @@ struct IRegion3D Int width() const { return hi.x - lo.x; } Int height() const { return hi.y - lo.y; } Int depth() const { return hi.z - lo.z; } + + Bool isInRegion( const ICoord2D& point ) const + { + return (lo.x < point.x) && (point.x < hi.x) && + (lo.y < point.y) && (point.y < hi.y); + } + + Bool isInRegion( Int x, Int y, Int z ) const + { + return (lo.x < x) && (x < hi.x) && + (lo.y < y) && (y < hi.y) && + (lo.z < z) && (z < hi.z); + } + + Bool isInRegion( const ICoord3D& point ) const { return isInRegion(point.x, point.y, point.z); } + + Bool isInRegion( const IRegion3D& other ) const + { + return (lo.x < other.lo.x) && (other.hi.x < hi.x) && + (lo.y < other.lo.y) && (other.hi.y < hi.y) && + (lo.z < other.lo.z) && (other.hi.z < hi.z); + } }; diff --git a/Core/Libraries/Include/Lib/Region2D.h b/Core/Libraries/Include/Lib/Region2D.h index 1b170ce22a7..877e211cd3f 100644 --- a/Core/Libraries/Include/Lib/Region2D.h +++ b/Core/Libraries/Include/Lib/Region2D.h @@ -60,5 +60,14 @@ struct Region2D Real width() const { return hi.x - lo.x; } Real height() const { return hi.y - lo.y; } + Bool isInRegion( Real x, Real y ) const { return (lo.x < x) && (x < hi.x) && (lo.y < y) && (y < hi.y); } + + Bool isInRegion( const Coord2D& point ) const { return isInRegion(point.x, point.y); } + + Bool isInRegion( const Region2D& other ) const + { + return (lo.x < other.lo.x) && (other.hi.x < hi.x) && + (lo.y < other.lo.y) && (other.hi.y < hi.y); + } }; diff --git a/Core/Libraries/Include/Lib/Region3D.h b/Core/Libraries/Include/Lib/Region3D.h index c87ab99bdbc..ff09240e547 100644 --- a/Core/Libraries/Include/Lib/Region3D.h +++ b/Core/Libraries/Include/Lib/Region3D.h @@ -99,16 +99,25 @@ struct Region3D } } - Bool isInRegionNoZ( const Coord3D &query ) const + Bool isInRegion( const Coord2D& point ) const { - return (lo.x < query.x) && (query.x < hi.x) && - (lo.y < query.y) && (query.y < hi.y); + return (lo.x < point.x) && (point.x < hi.x) && + (lo.y < point.y) && (point.y < hi.y); } - Bool isInRegion( const Coord3D &query ) const + Bool isInRegion( Real x, Real y, Real z ) const { - return (lo.x < query.x) && (query.x < hi.x) && - (lo.y < query.y) && (query.y < hi.y) && - (lo.z < query.z) && (query.z < hi.z); + return (lo.x < x) && (x < hi.x) && + (lo.y < y) && (y < hi.y) && + (lo.z < z) && (z < hi.z); + } + + Bool isInRegion( const Coord3D& point ) const { return isInRegion(point.x, point.y, point.z); } + + Bool isInRegion( const Region3D& other ) const + { + return (lo.x < other.lo.x) && (other.hi.x < hi.x) && + (lo.y < other.lo.y) && (other.hi.y < hi.y) && + (lo.z < other.lo.z) && (other.hi.z < hi.z); } }; diff --git a/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index adad428a760..1565efdd2e4 100644 --- a/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -849,7 +849,7 @@ LegalBuildCode BuildAssistant::isLocationLegalToBuild( const Coord3D *worldPos, /* You just can't never build off the map, regardless of options. jba. */ Region3D mapExtent; TheTerrainLogic->getMaximumPathfindExtent(&mapExtent); - if (!mapExtent.isInRegionNoZ(*worldPos)) { + if (!mapExtent.isInRegion(worldPos->asCoord2D())) { return LBC_RESTRICTED_TERRAIN; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index c11b3f69cf9..0b63ed59002 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -690,7 +690,7 @@ static void clampToMap(Coord3D *dest, PlayerType pt) extent.hi.y -= PATHFIND_CELL_SIZE_F; extent.lo.x += PATHFIND_CELL_SIZE_F; extent.lo.y += PATHFIND_CELL_SIZE_F; - if (!extent.isInRegionNoZ(*dest)) { + if (!extent.isInRegion(dest->asCoord2D())) { // clamp to in region. [8/28/2003] if (dest->x < extent.lo.x) { dest->x = extent.lo.x; @@ -1558,7 +1558,7 @@ void clampWaypointPosition( Coord3D &position, Int margin ) mapExtent.lo.x += margin; mapExtent.lo.y += margin; - if ( mapExtent.isInRegionNoZ( position ) == FALSE ) + if ( mapExtent.isInRegion( position.asCoord2D() ) == FALSE ) { if ( position.x > mapExtent.hi.x ) position.x = mapExtent.hi.x; diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index 3cd65080a0b..b0589ba6ae0 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -3836,7 +3836,7 @@ void AIFollowWaypointPathState::computeGoal(Bool useGroupOffsets) } Region3D extent; TheTerrainLogic->getMaximumPathfindExtent(&extent); - if (!extent.isInRegionNoZ(m_goalPosition)) { + if (!extent.isInRegion(m_goalPosition.asCoord2D())) { setAdjustsDestination(false); // moving off the map. ai->getCurLocomotor()->setAllowInvalidPosition(true); // allow it to move off the map. m_appendGoalPosition = true; // Moving off the map. diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index bb1e4cfcf4b..9da0cb95bfa 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1685,7 +1685,7 @@ void Object::reactToTransformChange(const Matrix3D* oldMtx, const Coord3D* oldPo Region3D mapExtent; TheTerrainLogic->getExtent(&mapExtent); - if (mapExtent.isInRegionNoZ(*getPosition())) + if (mapExtent.isInRegion(getPosition()->asCoord2D())) m_privateStatus &= ~OFF_MAP; else m_privateStatus |= OFF_MAP; @@ -2588,7 +2588,7 @@ void Object::friend_notifyOfNewMapBoundary() Region3D mapExtent; TheTerrainLogic->getExtent(&mapExtent); - if (mapExtent.isInRegionNoZ(*getPosition())) + if (mapExtent.isInRegion(getPosition()->asCoord2D())) m_privateStatus &= ~OFF_MAP; else m_privateStatus |= OFF_MAP; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 265ba0fb8ba..694f4b8c6b1 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -3973,7 +3973,7 @@ Bool PartitionManager::findPositionAround( const Coord3D *center, TheTerrainLogic->getMaximumPathfindExtent(&extent); // If the goal is off the map, it is a scripted setup, so just // use the center. - if (!extent.isInRegionNoZ(*center)) { + if (!extent.isInRegion(center->asCoord2D())) { *result = *center; return true; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 9c161b42dc6..526516e21e7 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -1658,10 +1658,10 @@ Bool AIUpdateInterface::computePath( PathfindServicesInterface *pathServices, Co m_retryPath = false; Region3D extent; TheTerrainLogic->getMaximumPathfindExtent(&extent); - if (!extent.isInRegionNoZ(*destination)) { + if (!extent.isInRegion(destination->asCoord2D())) { // We're going off the map. Coord3D pos = *getObject()->getPosition(); - if (!extent.isInRegionNoZ(pos)) { + if (!extent.isInRegion(pos.asCoord2D())) { // We're starting off the map. Since we're off the map, we can't pathfind so just build a path. return computeQuickPath(destination); } @@ -3857,7 +3857,7 @@ void AIUpdateInterface::privateGuardPosition( const Coord3D *pos, GuardMode guar // Clip to playable area. Region3D r; TheTerrainLogic->getExtent(&r); - if (!r.isInRegionNoZ(adjPos)) + if (!r.isInRegion(adjPos.asCoord2D())) adjPos = TheTerrainLogic->findClosestEdgePoint(&adjPos); } m_locationToGuard = adjPos; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index fa7e95830d2..d810ec2f6c0 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -176,7 +176,7 @@ class ChinookHeadOffMapState : public State Region3D mapRegion; TheTerrainLogic->getExtentIncludingBorder( &mapRegion ); - if (!mapRegion.isInRegionNoZ( *owner->getPosition() )) + if (!mapRegion.isInRegion( owner->getPosition()->asCoord2D() )) { TheGameLogic->destroyObject(owner); return STATE_SUCCESS; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp index e053a0d4b55..84016260c05 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp @@ -383,7 +383,7 @@ Bool DeliverPayloadAIUpdate::isOffMap() const Region3D mapRegion; TheTerrainLogic->getExtentIncludingBorder( &mapRegion ); - if (!mapRegion.isInRegionNoZ( *getObject()->getPosition() )) + if (!mapRegion.isInRegion( getObject()->getPosition()->asCoord2D() )) return true; return false; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp index 2080d293407..900d7f8aa53 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/ActionManager.cpp @@ -1464,7 +1464,7 @@ inline Bool isPointOnMap( const Coord3D *testPos ) { Region3D mapRegion; TheTerrainLogic->getExtent( &mapRegion ); - return mapRegion.isInRegionNoZ( *testPos ); + return mapRegion.isInRegion( testPos->asCoord2D() ); } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index ea396fc1b78..adf97d13a0c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -922,7 +922,7 @@ LegalBuildCode BuildAssistant::isLocationLegalToBuild( const Coord3D *worldPos, /* You just can't never build off the map, regardless of options. jba. */ Region3D mapExtent; TheTerrainLogic->getMaximumPathfindExtent(&mapExtent); - if (!mapExtent.isInRegionNoZ(*worldPos)) { + if (!mapExtent.isInRegion(worldPos->asCoord2D())) { return LBC_RESTRICTED_TERRAIN; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp index fec55987d77..2e08dea4dc6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp @@ -690,7 +690,7 @@ static void clampToMap(Coord3D *dest, PlayerType pt) extent.hi.y -= PATHFIND_CELL_SIZE_F; extent.lo.x += PATHFIND_CELL_SIZE_F; extent.lo.y += PATHFIND_CELL_SIZE_F; - if (!extent.isInRegionNoZ(*dest)) { + if (!extent.isInRegion(dest->asCoord2D())) { // clamp to in region. [8/28/2003] if (dest->x < extent.lo.x) { dest->x = extent.lo.x; @@ -1568,7 +1568,7 @@ void clampWaypointPosition( Coord3D &position, Int margin ) mapExtent.lo.x += margin; mapExtent.lo.y += margin; - if ( mapExtent.isInRegionNoZ( position ) == FALSE ) + if ( mapExtent.isInRegion( position.asCoord2D() ) == FALSE ) { if ( position.x > mapExtent.hi.x ) position.x = mapExtent.hi.x; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index 1526438ba16..a28625b7596 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -3939,9 +3939,9 @@ void AIFollowWaypointPathState::computeGoal(Bool useGroupOffsets) Region3D extent; TheTerrainLogic->getMaximumPathfindExtent(&extent); - if (extent.isInRegionNoZ(dest)) { + if (extent.isInRegion(dest.asCoord2D())) { // The waypoint is on the map. Check & see if the adjusted position is off map [8/28/2003] - if (!extent.isInRegionNoZ(m_goalPosition)) { + if (!extent.isInRegion(m_goalPosition.asCoord2D())) { // clamp to in region. [8/28/2003] if (m_goalPosition.x < extent.lo.x+PATHFIND_CELL_SIZE_F) { m_goalPosition.x = extent.lo.x+PATHFIND_CELL_SIZE_F; @@ -3958,7 +3958,7 @@ void AIFollowWaypointPathState::computeGoal(Bool useGroupOffsets) } } - if (!extent.isInRegionNoZ(m_goalPosition)) { + if (!extent.isInRegion(m_goalPosition.asCoord2D())) { setAdjustsDestination(false); // moving off the map. ai->getCurLocomotor()->setAllowInvalidPosition(true); // allow it to move off the map. m_appendGoalPosition = true; // Moving off the map. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 514c577a8cf..317c24523d7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1845,7 +1845,7 @@ void Object::reactToTransformChange(const Matrix3D* oldMtx, const Coord3D* oldPo Region3D mapExtent; TheTerrainLogic->getExtent(&mapExtent); - if (mapExtent.isInRegionNoZ(*getPosition())) + if (mapExtent.isInRegion(getPosition()->asCoord2D())) m_privateStatus &= ~OFF_MAP; else m_privateStatus |= OFF_MAP; @@ -2876,7 +2876,7 @@ void Object::friend_notifyOfNewMapBoundary() Region3D mapExtent; TheTerrainLogic->getExtent(&mapExtent); - if (mapExtent.isInRegionNoZ(*getPosition())) + if (mapExtent.isInRegion(getPosition()->asCoord2D())) m_privateStatus &= ~OFF_MAP; else m_privateStatus |= OFF_MAP; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index a7f9cad0123..269a75f986f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -3983,7 +3983,7 @@ Bool PartitionManager::findPositionAround( const Coord3D *center, TheTerrainLogic->getMaximumPathfindExtent(&extent); // If the goal is off the map, it is a scripted setup, so just // use the center. - if (!extent.isInRegionNoZ(*center)) { + if (!extent.isInRegion(center->asCoord2D())) { *result = *center; return true; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 4129b4742c2..195fcf552f9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -1679,10 +1679,10 @@ Bool AIUpdateInterface::computePath( PathfindServicesInterface *pathServices, Co m_retryPath = false; Region3D extent; TheTerrainLogic->getMaximumPathfindExtent(&extent); - if (!extent.isInRegionNoZ(*destination)) { + if (!extent.isInRegion(destination->asCoord2D())) { // We're going off the map. Coord3D pos = *getObject()->getPosition(); - if (!extent.isInRegionNoZ(pos)) { + if (!extent.isInRegion(pos.asCoord2D())) { // We're starting off the map. Since we're off the map, we can't pathfind so just build a path. return computeQuickPath(destination); } @@ -4081,7 +4081,7 @@ void AIUpdateInterface::privateGuardPosition( const Coord3D *pos, GuardMode guar // Clip to playable area. Region3D r; TheTerrainLogic->getExtent(&r); - if (!r.isInRegionNoZ(adjPos)) + if (!r.isInRegion(adjPos.asCoord2D())) adjPos = TheTerrainLogic->findClosestEdgePoint(&adjPos); } m_locationToGuard = adjPos; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index 5d95f59f500..5a7b1e53e93 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -169,7 +169,7 @@ class ChinookHeadOffMapState : public State Region3D mapRegion; TheTerrainLogic->getExtentIncludingBorder( &mapRegion ); - if( !mapRegion.isInRegionNoZ( *owner->getPosition() ) ) + if( !mapRegion.isInRegion( owner->getPosition()->asCoord2D() ) ) { TheGameLogic->destroyObject(owner); return STATE_SUCCESS; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp index ca618b60a80..31feecf6334 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeliverPayloadAIUpdate.cpp @@ -384,7 +384,7 @@ Bool DeliverPayloadAIUpdate::isOffMap() const Region3D mapRegion; TheTerrainLogic->getExtentIncludingBorder( &mapRegion ); - if (!mapRegion.isInRegionNoZ( *getObject()->getPosition() )) + if (!mapRegion.isInRegion( getObject()->getPosition()->asCoord2D() )) return true; return false; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp index b2368da9f35..e3a67257382 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp @@ -306,7 +306,7 @@ Bool SpectreGunshipUpdate::isPointOffMap( const Coord3D& testPos ) const Region3D mapRegion; TheTerrainLogic->getExtentIncludingBorder( &mapRegion ); - if (!mapRegion.isInRegionNoZ( testPos )) + if (!mapRegion.isInRegion( testPos.asCoord2D() )) return true; return false;