diff options
| author | Shauren <shauren.trinity@gmail.com> | 2012-08-10 14:10:57 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2012-08-10 14:10:57 +0200 |
| commit | 9538fb6d5a508adbebc9dd94ce25cbca6bd48789 (patch) | |
| tree | e604080395845db3826549230689c299b83824c0 /src/server/game/Entities/Unit | |
| parent | 5e1e9bb4dd10979c3bdf8debafc4e669355d4586 (diff) | |
Core/Movement: Ensured object orientation is always within 0-2pi range, this fixes movement.
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 19 | ||||
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.h | 8 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cedf38cb676..9ca0d23006c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16257,20 +16257,20 @@ void Unit::SendMoveRoot(uint32 value) data.WriteBit(guid[4]); data.WriteBit(guid[1]); data.WriteBit(guid[3]); - + data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[5]); - + data << uint32(value); - - + + data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[6]); - + SendMessageToSet(&data, true); } @@ -16286,19 +16286,19 @@ void Unit::SendMoveUnroot(uint32 value) data.WriteBit(guid[2]); data.WriteBit(guid[4]); data.WriteBit(guid[6]); - + data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[6]); data.WriteByteSeq(guid[1]); - + data << uint32(value); - + data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[5]); - + SendMessageToSet(&data, true); } @@ -17849,6 +17849,7 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel return false; } + orientation = MapManager::NormalizeOrientation(orientation); bool turn = (GetOrientation() != orientation); bool relocated = (teleport || GetPositionX() != x || GetPositionY() != y || GetPositionZ() != z); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index de95b7d9842..7a0b97b90ef 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -711,6 +711,12 @@ enum MovementFlags MOVEMENTFLAG_MASK_MOVING_FLY = MOVEMENTFLAG_FLYING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING, + // Movement flags allowed for creature in CreateObject - we need to keep all other enabled serverside + // to properly calculate all movement + MOVEMENTFLAG_MASK_CREATURE_ALLOWED = + MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_DISABLE_GRAVITY | MOVEMENTFLAG_ROOT | MOVEMENTFLAG_SWIMMING | + MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_WATERWALKING | MOVEMENTFLAG_FALLING_SLOW | MOVEMENTFLAG_HOVER, + //! TODO if needed: add more flags to this masks that are exclusive to players MOVEMENTFLAG_MASK_PLAYER_ONLY = MOVEMENTFLAG_FLYING, @@ -1407,7 +1413,7 @@ class Unit : public WorldObject MountCapabilityEntry const* GetMountCapability(uint32 mountType) const; void SendDurabilityLoss(Player* receiver, uint32 percent); - + uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb); uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); |
