Entities/Unit: Cleanup all the direct accesses to m_unitMovedByMe. Refactor the field to be protected. Add assertions to catch dangling pointers.

Port From (https://github.com/TrinityCore/TrinityCore/commit/edc75831194bc2419e3abada47121fadf4b2aa8d)
This commit is contained in:
hondacrx
2021-12-23 20:17:08 -05:00
parent 4584543d45
commit 1f58dc2b53
5 changed files with 41 additions and 48 deletions
+2 -1
View File
@@ -42,8 +42,9 @@ namespace Game.Entities
MotionMaster i_motionMaster;
public uint m_movementCounter; //< Incrementing counter used in movement packets
TimeTrackerSmall movesplineTimer;
public Player m_playerMovingMe;
MovementForces _movementForces;
protected Unit m_unitMovedByMe; // only ever set for players, and only for direct client control
protected Player m_playerMovingMe; // only set for direct client control (possess effects, vehicles and similar)
//Combat
protected List<Unit> attackerList = new();