[8880] Some adjustments/additions for updateflag_living and flying creatures

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2009-11-27 16:33:09 +01:00
parent 47cda41d93
commit 980a0d6a64
2 changed files with 22 additions and 2 deletions

View file

@ -261,7 +261,27 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2)
{
case TYPEID_UNIT:
{
flags2 = ((Creature*)this)->canFly() ? (MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_LEVITATING) : MOVEMENTFLAG_NONE;
flags2 = MOVEMENTFLAG_NONE;
if (!((Creature*)this)->IsStopped())
flags2 |= MOVEMENTFLAG_FORWARD; // not set if not really moving
if (((Creature*)this)->canFly())
{
flags2 |= MOVEMENTFLAG_LEVITATING; // (ok) most seem to have this
if (((Creature*)this)->IsStopped())
flags2 |= MOVEMENTFLAG_FLY_UNK1; // (ok) possibly some "hover" mode
else
{
if (((Creature*)this)->IsMounted())
flags2 |= MOVEMENTFLAG_FLYING; // seems to be often when mounted
/* for further research
else
flags2 |= MOVEMENTFLAG_FLYING2; // not seen, but work on some, even if not "correct"
*/
}
}
}
break;
case TYPEID_PLAYER: