From 48799f33768c70f77f15398376318373f705db65 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 18 Mar 2012 11:35:33 +0100 Subject: Core/Units: Fix movementflag apply for flying/hovering creatures on respawn --- src/server/game/Entities/Creature/Creature.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ca893a7c482..47225c65396 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1540,9 +1540,11 @@ void Creature::setDeathState(DeathState s) ResetPlayerDamageReq(); CreatureTemplate const* cinfo = GetCreatureTemplate(); SetWalk(true); - if (GetCreatureTemplate()->InhabitType & INHABIT_AIR) + if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND) + SetCanFly(true); + else if (cinfo->InhabitType & INHABIT_AIR) SetDisableGravity(true); - if (GetCreatureTemplate()->InhabitType & INHABIT_WATER) + if (cinfo->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); -- cgit v1.2.3