[9191] Fixed crashes related to recently totem acccess function

* No search if not in world (no totems then)
* Check NULL.
This commit is contained in:
VladimirMangos 2010-01-16 18:15:26 +03:00
parent 5a4944385e
commit c6d378ad70
2 changed files with 3 additions and 3 deletions

View file

@ -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()

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9190"
#define REVISION_NR "9191"
#endif // __REVISION_NR_H__