mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[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:
parent
5a4944385e
commit
c6d378ad70
2 changed files with 3 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9190"
|
||||
#define REVISION_NR "9191"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue