diff options
| author | Shauren <shauren.trinity@gmail.com> | 2017-02-27 19:30:44 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-02-27 19:30:44 +0100 |
| commit | c7cd51e8f543de04b2953eada7a57897a5c0161d (patch) | |
| tree | 398c3ca17d257bd60fb0249fb3071e83201c9a8f /src/server/game/Entities/Unit | |
| parent | 87b6b9c27fa5a0f451a3b45e82bdee6c9be38a35 (diff) | |
Core/Movement: New names for a few spline flags
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 12 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a7ee9419d2c..67f8f2d74b5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14904,6 +14904,18 @@ bool Unit::IsFalling() const return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR) || movespline->isFalling(); } +bool Unit::CanSwim() const +{ + // Mirror client behavior, if this method returns false then client will not use swimming animation and for players will apply gravity as if there was no water + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CANNOT_SWIM)) + return false; + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) // is player + return true; + if (HasFlag(UNIT_FIELD_FLAGS_2, 0x1000000)) + return false; + return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_RENAME | UNIT_FLAG_UNK_15); +} + void Unit::NearTeleportTo(Position const& pos, bool casting /*= false*/) { DisableSpline(); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 0e17db6b544..054db0ef5eb 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -786,6 +786,7 @@ enum NPCFlags : uint64 UNIT_NPC_FLAG_BLACK_MARKET = 0x0080000000, // black market UNIT_NPC_FLAG_ITEM_UPGRADE_MASTER = 0x0100000000, UNIT_NPC_FLAG_GARRISON_ARCHITECT = 0x0200000000, + UNIT_NPC_FLAG_STEERING = 0x0400000000, UNIT_NPC_FLAG_SHIPMENT_CRAFTER = 0x1000000000, UNIT_NPC_FLAG_GARRISON_MISSION_NPC = 0x2000000000, UNIT_NPC_FLAG_TRADESKILL_NPC = 0x4000000000, @@ -2246,6 +2247,7 @@ class TC_GAME_API Unit : public WorldObject virtual bool CanFly() const = 0; bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_DISABLE_GRAVITY); } bool IsFalling() const; + virtual bool CanSwim() const; void RewardRage(uint32 baseRage); |
