*Fix the bug that sometimes vehicle is not usable after respawn.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-25 00:56:23 -05:00
parent 01530fb148
commit d14a4a2372

View File

@@ -1794,9 +1794,7 @@ void Creature::setDeathState(DeathState s)
SetHealth(GetMaxHealth());
SetLootRecipient(NULL);
ResetPlayerDamageReq();
Unit::setDeathState(ALIVE);
CreatureInfo const *cinfo = GetCreatureInfo();
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
clearUnitState(UNIT_STAT_ALL_STATE);
@@ -1805,6 +1803,7 @@ void Creature::setDeathState(DeathState s)
Motion_Initialize();
if(GetCreatureData() && GetPhaseMask() != GetCreatureData()->phaseMask)
SetPhaseMask(GetCreatureData()->phaseMask, false);
Unit::setDeathState(ALIVE);
}
}