diff options
| author | megamage <none@none> | 2009-08-26 19:28:21 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-08-26 19:28:21 -0500 |
| commit | 21af4cf832daeccb1617e37e15cd7b9bcebfb6c8 (patch) | |
| tree | 04d46e30bc492ba8aa7b449ab2a3f721e95d96a3 /src/game/Creature.cpp | |
| parent | 390257b2f6d4d4b03a3226a39b478b3ea92b4dea (diff) | |
*Some clean up and add debug info to find the reason of crash.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
| -rw-r--r-- | src/game/Creature.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 330c93429b6..5441a42c94a 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -204,7 +204,8 @@ void Creature::DisappearAndDie() //DestroyForNearbyPlayers(); SetVisibility(VISIBILITY_OFF); ObjectAccessor::UpdateObjectVisibility(this); - setDeathState(JUST_DIED); + if(isAlive()) + setDeathState(JUST_DIED); } void Creature::SearchFormationAndPath() @@ -561,10 +562,6 @@ void Creature::Update(uint32 diff) break; } case DEAD_FALLING: - { - if (!FallGround()) - setDeathState(JUST_DIED); - } default: break; } @@ -1763,9 +1760,6 @@ void Creature::setDeathState(DeathState s) // always save boss respawn time at death to prevent crash cheating if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss()) SaveRespawnTime(); - - if (canFly() && FallGround()) - return; } Unit::setDeathState(s); @@ -1780,17 +1774,18 @@ void Creature::setDeathState(DeathState s) if ( LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId) ) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); - if (canFly() && FallGround()) - return; - SetNoSearchAssistance(false); - Unit::setDeathState(CORPSE); //Dismiss group if is leader if(m_formation && m_formation->getLeader() == this) m_formation->FormationReset(true); + + if (canFly() && FallGround()) + return; + + Unit::setDeathState(CORPSE); } - if(s == JUST_ALIVED) + else if(s == JUST_ALIVED) { //if(isPet()) // setActive(true); @@ -1822,9 +1817,8 @@ bool Creature::FallGround() if (fabs(ground_Z - z) < 0.1f) return false; + GetMotionMaster()->MovePoint(EVENT_FALL_GROUND, x, y, ground_Z); Unit::setDeathState(DEAD_FALLING); - GetMotionMaster()->MovePoint(0, x, y, ground_Z); - Relocate(x, y, ground_Z); return true; } |
