Added safety check to [tar] dereference

This commit is contained in:
Uleat 2019-11-05 18:58:46 -05:00
parent cd7584f512
commit 397619e2f9

View File

@ -2156,7 +2156,7 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
if(castedSpell) {
char* gmsg = nullptr;
if(tar != this) {
if(tar && tar != this) { // [tar] was implicitly valid at this point..this change is to catch any bad logic
//we don't need spam of bots healing themselves
MakeAnyLenString(&gmsg, "Casting %s on %s.", spells[selectedMercSpell.spellid].name, tar->GetCleanName());
if(gmsg)