Core/Movement: Fix a potential crash on newly created pets.

Port From (https://github.com/TrinityCore/TrinityCore/commit/3d9d6fbcb80eaab72acbe6ef09b9b1c29f2439c7)
This commit is contained in:
hondacrx
2021-09-26 10:31:46 -04:00
parent ad1975b277
commit 9d5cf1d4ae
3 changed files with 13 additions and 8 deletions
+5
View File
@@ -804,6 +804,11 @@ namespace Game.Movement
int Size() { return _top + 1; }
public IMovementGenerator TopOrNull()
{
return Empty() ? null : Top();
}
public IMovementGenerator Top()
{
Cypher.Assert(!Empty());