Core/Misc: Ensure GetVictim() returns a valid reference when expected
Add a new method EnsureVictim() which asserts a valid not NULL reference will be returned to the caller. Use this whenever the GetVictim() would be dereferenced .
This commit is contained in:
1 parent
fac3f445b1
commit
8ca6371793
39 files changed
+73
-67
No files matched your search
@@ -74,7 +74,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
|
||||
return false;
|
||||
|
||||
//not a player
|
||||
if (!who->GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
if (!who->EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
return false;
|
||||
|
||||
//never attack friendly
|
||||
|
||||
Reference in new issue
Block a user