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
@@ -828,6 +832,7 @@ class ThingTemplate : public Overridable
828
832
UnsignedByte m_crushableLevel; ///< Specifies the level of crushability (must be hit by a crusher greater than this to crush me).
829
833
Byte m_ammoPipsStyle; ///< How ammo pips are displayed for this thing
830
834
UnsignedByte m_maxPathfindingCellRadius; ///< Limit cells radius for pathfinding, defaults to 2, can be increased for large units
835
+
Byte m_requiredBridgeHeight; ///< simplified height required to fit under bridge, range: -1 to 15, -1 will use Geometry height, other values to override
ObjectID m_obstacleID; ///< the object ID who overlaps this cell
@@ -409,6 +429,9 @@ class PathfindCell
409
429
UnsignedByte m_layer : 4; ///< Layer of this cell.
410
430
//This is added for ship pathing
411
431
Short m_waterLevel:8; ///< how far away is this cell from land (distance transform), capped at 15
432
+
//This is added for bridge pathing, determine if unit can go under bridge or not
433
+
UnsignedByte m_bridgeHeight : 4; // stored as number 0-15, rounded from 0.0-150.0 float. Space below bridge (to ground or water)
434
+
UnsignedByte m_bridgeLayer : 4; // Layer number of bridge above this cell
412
435
};
413
436
414
437
typedef PathfindCell *PathfindCellP;
@@ -660,7 +683,7 @@ class Pathfinder : PathfindServicesInterface, public Snapshot
660
683
voidxfer( Xfer *xfer );
661
684
voidloadPostProcess( void );
662
685
663
-
Bool clientSafeQuickDoesPathExist( const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D *to ); ///< Can we build any path at all between the locations (terrain & buildings check - fast)
686
+
Bool clientSafeQuickDoesPathExist( const LocomotorSet& locomotorSet, Short requiredBridgeHeight, const Coord3D *from, const Coord3D *to ); ///< Can we build any path at all between the locations (terrain & buildings check - fast)
664
687
Bool clientSafeQuickDoesPathExistForUI( const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D *to ); ///< Can we build any path at all between the locations (terrain onlyk - fast)
const Coord3D *to, ObjectID ignoreObject=INVALID_ID ); ///< Can we build any path at all between the locations (terrain, buildings & units check - slower)
@@ -709,9 +732,9 @@ class Pathfinder : PathfindServicesInterface, public Snapshot
709
732
710
733
voidsetIgnoreObstacleID( ObjectID objID ); ///< if non-zero, the pathfinder will ignore the given obstacle
711
734
712
-
Bool validMovementPosition( Bool isCrusher, LocomotorSurfaceTypeMask acceptableSurfaces, Int requiredWaterLevel, PathfindCell *toCell, PathfindCell *fromCell = NULL ); ///< Return true if given position is a valid movement location
713
-
Bool validMovementPosition( Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet& locomotorSet, Int x, Int y ); ///< Return true if given position is a valid movement location
714
-
Bool validMovementPosition( Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet& locomotorSet, const Coord3D *pos ); ///< Return true if given position is a valid movement location
735
+
Bool validMovementPosition( Bool isCrusher, LocomotorSurfaceTypeMask acceptableSurfaces, Int requiredWaterLevel, Short requiredBridgeHeight, PathfindCell *toCell, PathfindCell *fromCell = NULL ); ///< Return true if given position is a valid movement location
736
+
Bool validMovementPosition( Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet& locomotorSet, Short requiredBridgeHeight, Int x, Int y ); ///< Return true if given position is a valid movement location
737
+
Bool validMovementPosition( Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet& locomotorSet, Short requiredBridgeHeight, const Coord3D *pos ); ///< Return true if given position is a valid movement location
715
738
Bool validMovementTerrain( PathfindLayerEnum layer, const Locomotor* locomotor, const Coord3D *pos ); ///< Return true if given position is a valid movement location
inline Bool Pathfinder::validMovementPosition( Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet& locomotorSet, Int x, Int y )
950
+
inline Bool Pathfinder::validMovementPosition( Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet& locomotorSet, Short requiredBridgeHeight, Int x, Int y )
Real getMinSpeed() const { return m_template->m_minSpeed;}
267
+
Real getMinTurnSpeed() const { return m_template->m_minTurnSpeed;} ///< must be going >= this speed to turn (0 = can turn in place)
267
268
Real getAccelPitchLimit() const { return m_template->m_accelPitchLimit;} ///< Maximum amount we will pitch up or down under acceleration (including recoil.)
268
269
Real getDecelPitchLimit() const { return m_template->m_decelPitchLimit;} ///< Maximum amount we will pitch down under deceleration (including recoil.)
269
270
Real getBounceKick() const { return m_template->m_bounceKick;} ///< How much simulating rough terrain "bounces" a wheel up.
Bool canComputeQuickPath(void); ///< Returns true if we can quickly comput a path. Usually missiles & the like that just move straight to the destination.
507
507
Bool computeQuickPath(const Coord3D *destination); ///< Computes a quick path to the destination.
508
+
Bool arePathLayersStillValid(); ///< Check if the current used layers are still passable
0 commit comments