|
36 | 36 |
|
37 | 37 | class Bridge; |
38 | 38 | class Object; |
39 | | -class PathfindCell; |
40 | | -class PathfindZoneManager; |
41 | 39 | class Weapon; |
| 40 | +class PathfindZoneManager; |
| 41 | +class PathfindCell; |
42 | 42 |
|
43 | 43 | // How close is close enough when moving. |
44 | 44 |
|
@@ -356,13 +356,13 @@ class PathfindCell |
356 | 356 | inline UnsignedInt getCostSoFar() const {return m_info->m_costSoFar;} |
357 | 357 | inline UnsignedInt getTotalCost() const {return m_info->m_totalCost;} |
358 | 358 |
|
359 | | - inline void setCostSoFar(UnsignedInt cost) {m_info->m_costSoFar = cost;} |
360 | | - inline void setTotalCost(UnsignedInt cost) {m_info->m_totalCost = cost;} |
| 359 | + inline void setCostSoFar(UnsignedInt cost) { if( m_info ) m_info->m_costSoFar = cost;} |
| 360 | + inline void setTotalCost(UnsignedInt cost) { if( m_info ) m_info->m_totalCost = cost;} |
361 | 361 |
|
362 | 362 | void setParentCell(PathfindCell* parent); |
363 | 363 | void clearParentCell(); |
364 | 364 | void setParentCellHierarchical(PathfindCell* parent); |
365 | | - inline PathfindCell* getParentCell() const {return m_info->m_pathParent?m_info->m_pathParent->m_cell: nullptr;} |
| 365 | + inline PathfindCell* getParentCell() const {return m_info ? m_info->m_pathParent ? m_info->m_pathParent->m_cell : nullptr : nullptr;} |
366 | 366 |
|
367 | 367 | Bool startPathfind( PathfindCell *goalCell ); |
368 | 368 | Bool getPinched() const {return m_pinched;} |
@@ -590,7 +590,7 @@ class PathfindServicesInterface { |
590 | 590 | virtual Path *findPath( Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, |
591 | 591 | const Coord3D *to )=0; ///< Find a short, valid path between given locations |
592 | 592 | /** Find a short, valid path to a location NEAR the to location. |
593 | | - This succeds when the destination is unreachable (like inside a building). |
| 593 | + This succeeds when the destination is unreachable (like inside a building). |
594 | 594 | If the destination is unreachable, it will adjust the to point. */ |
595 | 595 | virtual Path *findClosestPath( Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, |
596 | 596 | Coord3D *to, Bool blocked, Real pathCostMultiplier, Bool moveAllies )=0; |
@@ -619,7 +619,7 @@ class Pathfinder : PathfindServicesInterface, public Snapshot |
619 | 619 | private: |
620 | 620 | virtual Path *findPath( Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, const Coord3D *to); ///< Find a short, valid path between given locations |
621 | 621 | /** Find a short, valid path to a location NEAR the to location. |
622 | | - This succeds when the destination is unreachable (like inside a building). |
| 622 | + This succeeds when the destination is unreachable (like inside a building). |
623 | 623 | If the destination is unreachable, it will adjust the to point. */ |
624 | 624 | virtual Path *findClosestPath( Object *obj, const LocomotorSet& locomotorSet, const Coord3D *from, |
625 | 625 | Coord3D *to, Bool blocked, Real pathCostMultiplier, Bool moveAllies ); |
|
0 commit comments