aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-03-28 23:52:58 +0100
committerShauren <shauren.trinity@gmail.com>2013-03-28 23:52:58 +0100
commitf63fd0bc184448c0a910da52ad71332063857e28 (patch)
tree6ca514753a32322a62298cc247c0f1701fa195cb /src
parent1b8d917ea9ba4cb7190a8da94d9128cb9bd561a4 (diff)
Core/Spells: Fixed a crash with summoning Wild Mushrooms
Diffstat (limited to 'src')
-rw-r--r--src/server/game/DataStores/DBCStructure.h2
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index 4426c6388c7..0e283cbb5e5 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -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
};
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index d23af7e215f..320260a85fb 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -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());