aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-08 17:58:58 -0500
committermegamage <none@none>2009-08-08 17:58:58 -0500
commit94d048311da406d28fc207a21faa246416329171 (patch)
treefaafff9a76b8f51554dd2e3e0e1b1fac4476c1dc /src
parenta78a0c6b0175aeec85ed3a53ddb52dcf5eeebdcf (diff)
*Fix a crash caused by undismissed pet.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/TemporarySummon.cpp8
-rw-r--r--src/game/Unit.cpp4
2 files changed, 8 insertions, 4 deletions
diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp
index 8e04bc22c68..434750c8744 100644
--- a/src/game/TemporarySummon.cpp
+++ b/src/game/TemporarySummon.cpp
@@ -224,7 +224,13 @@ void TempSummon::SetTempSummonType(TempSummonType type)
void TempSummon::UnSummon()
{
- assert(!isPet());
+ //assert(!isPet());
+ if(isPet())
+ {
+ ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
+ assert(!IsInWorld());
+ return;
+ }
Unit* owner = GetSummoner();
if(owner && owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->IsAIEnabled)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 0de06b9e9a9..74eda6482d0 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -9138,9 +9138,7 @@ void Unit::RemoveAllControlled()
&& target->GetTypeId() == TYPEID_UNIT
&& ((Creature*)target)->HasSummonMask(SUMMON_MASK_SUMMON))
{
-
- if(!((TempSummon*)target)->isPet())
- ((TempSummon*)target)->UnSummon();
+ ((TempSummon*)target)->UnSummon();
}
else
{