From aa31f350b35b3c0e6721e3de173a532107efdffa Mon Sep 17 00:00:00 2001 From: thenecromancer Date: Sat, 3 Apr 2010 12:39:02 +0200 Subject: [PATCH] Fix waypoint movement removing flying animation for creatures Fix flying creatures always moving forward ( maybe use flag only when really moving? ) --HG-- branch : trunk --- src/game/Unit.cpp | 2 +- src/game/WaypointMovementGenerator.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 07a62e97a2..4fa18fa260 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -15945,7 +15945,7 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const { case TYPEID_UNIT: if (canFly()) - const_cast(this)->AddUnitMovementFlag(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_LEVITATING); + const_cast(this)->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); break; case TYPEID_PLAYER: // remove unknown, unused etc flags for now diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 2437f5d48e..a31afaa5b1 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -86,6 +86,10 @@ void WaypointMovementGenerator::InitTraveller(Creature &unit, const Wa unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + // TODO: make this part of waypoint node, so that creature can walk when desired? + if (unit.canFly()) + SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); + unit.addUnitState(UNIT_STAT_ROAMING); }