You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const Coord3D *fromPos, PathfindCell *goalCell, Bool center, Bool blocked ); ///< Work backwards from goal cell to construct final path
812
+
const Coord3D *fromPos, PathfindCell *goalCell, Bool center, Bool blocked, Int requireWaterLevel ); ///< Work backwards from goal cell to construct final path
UnsignedByte m_flags:4; ///< what type of units are in or moving through this cell.
374
377
UnsignedByte m_connectsToLayer:4; ///< This cell can pathfind onto this layer, if > LAYER_TOP.
375
378
UnsignedByte m_layer:4; ///< Layer of this cell.
379
+
//This is added for ship pathing
380
+
Short m_waterLevel:8; ///< how far away is this cell from land (distance transform), capped at 15
376
381
};
377
382
378
383
typedef PathfindCell *PathfindCellP;
@@ -673,7 +678,7 @@ class Pathfinder : PathfindServicesInterface, public Snapshot
673
678
674
679
voidsetIgnoreObstacleID( ObjectID objID ); ///< if non-zero, the pathfinder will ignore the given obstacle
675
680
676
-
Bool validMovementPosition( Bool isCrusher, LocomotorSurfaceTypeMask acceptableSurfaces, PathfindCell *toCell, PathfindCell *fromCell = NULL ); ///< Return true if given position is a valid movement location
681
+
Bool validMovementPosition( Bool isCrusher, LocomotorSurfaceTypeMask acceptableSurfaces, Int requiredWaterLevel, PathfindCell *toCell, PathfindCell *fromCell = NULL ); ///< Return true if given position is a valid movement location
677
682
Bool validMovementPosition( Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet& locomotorSet, Int x, Int y ); ///< Return true if given position is a valid movement location
678
683
Bool validMovementPosition( Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet& locomotorSet, const Coord3D *pos ); ///< Return true if given position is a valid movement location
679
684
Bool validMovementTerrain( PathfindLayerEnum layer, const Locomotor* locomotor, const Coord3D *pos ); ///< Return true if given position is a valid movement location
@@ -686,7 +691,7 @@ class Pathfinder : PathfindServicesInterface, public Snapshot
const Coord3D *fromPos, PathfindCell *goalCell, Bool center, Bool blocked ); ///< Work backwards from goal cell to construct final path
825
+
const Coord3D *fromPos, PathfindCell *goalCell, Bool center, Bool blocked, Int requiredWaterLevel ); ///< Work backwards from goal cell to construct final path
virtual Bool processCollision(PhysicsBehavior *physics, Object *other); ///< Returns true if the physics collide should apply the force. Normally not. jba.
0 commit comments