aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index eb711a77ab5..be0747f0a89 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1780,7 +1780,7 @@ void Creature::setDeathState(DeathState s)
LoadCreaturesAddon(true);
Motion_Initialize();
if(GetCreatureData() && GetPhaseMask() != GetCreatureData()->phaseMask)
- SetPhaseMask(GetCreatureData()->phaseMask, true);
+ SetPhaseMask(GetCreatureData()->phaseMask, false);
}
}
@@ -1802,16 +1802,19 @@ bool Creature::FallGround()
return true;
}
-void Creature::Respawn()
+void Creature::Respawn(bool force)
{
- RemoveCorpse();
+ DestroyForNearbyPlayers();
- // forced recreate creature object at clients
- UnitVisibility currentVis = GetVisibility();
- SetVisibility(VISIBILITY_RESPAWN);
- ObjectAccessor::UpdateObjectVisibility(this);
- SetVisibility(currentVis); // restore visibility state
- ObjectAccessor::UpdateObjectVisibility(this);
+ if(force)
+ {
+ if(isAlive())
+ setDeathState(JUST_DIED);
+ else if(getDeathState() != CORPSE)
+ setDeathState(CORPSE);
+ }
+
+ RemoveCorpse();
if(getDeathState()==DEAD)
{
@@ -1846,11 +1849,9 @@ void Creature::Respawn()
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), GetTypeId());
if (poolid)
poolhandler.UpdatePool(poolid, GetGUIDLow(), GetTypeId());
-
- //GetMap()->Add(this);
-
-
}
+
+ SetToNotify();
}
bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo)