From c6d378ad70c1c82c3fb6512f7968ddbc86dc1e1d Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 16 Jan 2010 18:15:26 +0300 Subject: [PATCH] [9191] Fixed crashes related to recently totem acccess function * No search if not in world (no totems then) * Check NULL. --- src/game/Unit.cpp | 4 ++-- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index d33fa88c4..b4113eab0 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8449,11 +8449,11 @@ Unit* Unit::_GetTotem(uint8 slot) const Totem* Unit::GetTotem( uint8 slot ) const { - if(slot >= MAX_TOTEM) + if(slot >= MAX_TOTEM || !IsInWorld()) return NULL; Creature *totem = GetMap()->GetCreature(m_TotemSlot[slot]); - return totem->isTotem() ? (Totem*)totem : NULL; + return totem && totem->isTotem() ? (Totem*)totem : NULL; } void Unit::UnsummonAllTotems() diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f1849783a..7d0db1903 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9190" + #define REVISION_NR "9191" #endif // __REVISION_NR_H__