mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-18 16:09:37 +01:00
Core/Spells: Fixed a crash with summoning Wild Mushrooms
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user