Core/Spells: Fixed a crash with summoning Wild Mushrooms

This commit is contained in:
Shauren
2013-03-28 23:52:58 +01:00
parent 1b8d917ea9
commit f63fd0bc18
2 changed files with 7 additions and 3 deletions

View File

@@ -2044,7 +2044,7 @@ struct SummonPropertiesEntry
uint32 Category; // 1, 0 - can't be controlled?, 1 - something guardian?, 2 - pet?, 3 - something controllable?, 4 - taxi/mount?
uint32 Faction; // 2, 14 rows > 0
uint32 Type; // 3, see enum
uint32 Slot; // 4, 0-6
int32 Slot; // 4, 0-6
uint32 Flags; // 5
};

View File

@@ -196,7 +196,8 @@ void TempSummon::InitStats(uint32 duration)
if (owner)
{
if (uint32 slot = m_Properties->Slot)
int32 slot = m_Properties->Slot;
if (slot > 0)
{
if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())
{
@@ -268,10 +269,13 @@ void TempSummon::RemoveFromWorld()
return;
if (m_Properties)
if (uint32 slot = m_Properties->Slot)
{
int32 slot = m_Properties->Slot;
if (slot > 0)
if (Unit* owner = GetSummoner())
if (owner->m_SummonSlot[slot] == GetGUID())
owner->m_SummonSlot[slot] = 0;
}
//if (GetOwnerGUID())
// sLog->outError(LOG_FILTER_UNITS, "Unit %u has owner guid when removed from world", GetEntry());