diff --git a/src/server/game/Accounts/RBAC.cpp b/src/server/game/Accounts/RBAC.cpp index a8720b66df..34d7687452 100644 --- a/src/server/game/Accounts/RBAC.cpp +++ b/src/server/game/Accounts/RBAC.cpp @@ -236,10 +236,10 @@ void RBACData::AddPermissions(RBACPermissionContainer const& permsFrom, RBACPerm permsTo.insert(*itr); } -void RBACData::RemovePermissions(RBACPermissionContainer const& permsFrom, RBACPermissionContainer& permsTo) +void RBACData::RemovePermissions(RBACPermissionContainer& permsFrom, RBACPermissionContainer const& permsToRemove) { - for (RBACPermissionContainer::const_iterator itr = permsFrom.begin(); itr != permsFrom.end(); ++itr) - permsTo.erase(*itr); + for (RBACPermissionContainer::const_iterator itr = permsToRemove.begin(); itr != permsToRemove.end(); ++itr) + permsFrom.erase(*itr); } void RBACData::ExpandPermissions(RBACPermissionContainer& permissions) diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 11ddea00a0..eb1a3b9788 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -947,8 +947,8 @@ class RBACData /// Adds a list of permissions to another list void AddPermissions(RBACPermissionContainer const& permsFrom, RBACPermissionContainer& permsTo); - /// Removes a list of permissions to another list - void RemovePermissions(RBACPermissionContainer const& permsFrom, RBACPermissionContainer& permsTo); + /// Removes a list of permissions from another list + void RemovePermissions(RBACPermissionContainer& permsFrom, RBACPermissionContainer const& permsToRemove); /** * @name ExpandPermissions diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 07da1e7f37..e8f6bde297 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1617,7 +1617,6 @@ class Player : public Unit, public GridObject void SaveGoldToDB(SQLTransaction& trans) const; static void SetUInt32ValueInArray(Tokenizer& data, uint16 index, uint32 value); - static void SetFloatValueInArray(Tokenizer& data, uint16 index, float value); static void Customize(CharacterCustomizeInfo const* customizeInfo, SQLTransaction& trans); static void SavePositionInDB(WorldLocation const& loc, uint16 zoneId, ObjectGuid guid, SQLTransaction& trans); @@ -1631,7 +1630,6 @@ class Player : public Unit, public GridObject void SetBindPoint(ObjectGuid guid) const; void SendTalentWipeConfirm(ObjectGuid guid) const; void ResetPetTalents(); - void CalcRage(uint32 damage, bool attacker); void RegenerateAll(); void Regenerate(Powers power); void RegenerateHealth(); @@ -1823,7 +1821,7 @@ class Player : public Unit, public GridObject PvPInfo pvpInfo; void UpdatePvPState(bool onlyFFA = false); - void SetPvP(bool state); + void SetPvP(bool state) override; void UpdatePvP(bool state, bool override=false); void UpdateZone(uint32 newZone, uint32 newArea); void UpdateArea(uint32 newArea); @@ -1915,7 +1913,7 @@ class Player : public Unit, public GridObject void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) override; - inline void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);} + void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);} float GetMeleeCritFromAgility() const; void GetDodgeFromAgility(float &diminishing, float &nondiminishing) const; float GetSpellCritFromIntellect() const; @@ -1978,8 +1976,8 @@ class Player : public Unit, public GridObject void SendResetInstanceFailed(uint32 reason, uint32 MapId) const; void SendResetFailedNotify(uint32 mapid) const; - virtual bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override; - bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } + bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override; + bool UpdatePosition(const Position &pos, bool teleport = false) override { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } void UpdateUnderwaterState(Map* m, float x, float y, float z) override; void SendMessageToSet(WorldPacket* data, bool self) override { SendMessageToSetInRange(data, GetVisibilityRange(), self); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5c1e94872c..22f5f9cd2c 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1402,7 +1402,8 @@ class Unit : public WorldObject bool IsContestedGuard() const; bool IsPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); } bool IsFFAPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); } - void SetPvP(bool state); + virtual void SetPvP(bool state); + uint32 GetCreatureType() const; uint32 GetCreatureTypeMask() const; @@ -1576,7 +1577,7 @@ class Unit : public WorldObject void SendTeleportPacket(Position& pos); virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false); // returns true if unit's position really changed - bool UpdatePosition(const Position &pos, bool teleport = false); + virtual bool UpdatePosition(const Position &pos, bool teleport = false); void UpdateOrientation(float orientation); void UpdateHeight(float newZ); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index efb2b85c1f..bffa1a9a28 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6580,7 +6580,12 @@ uint32 ObjectMgr::GenerateMailID() uint32 ObjectMgr::GeneratePetNumber() { - return ++_hiPetNumber; + if (_hiPetNumber >= 0xFFFFFFFE) + { + TC_LOG_ERROR("misc", "_hiPetNumber Id overflow!! Can't continue, shutting down server. "); + World::StopNow(ERROR_EXIT_CODE); + } + return _hiPetNumber++; } uint64 ObjectMgr::GenerateVoidStorageItemId() diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 8c76f55c0b..c44e2d8808 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1076,9 +1076,8 @@ BeepAtStart = 1 # # Motd -# Description: Message of the Day, displayed at login. -# Use '@' for a newline and be sure to escape special characters. -# Example: "Welcome to John\'s Server@This server runs on Trinity Core." +# Description: Message of the Day, displayed at login. Use '@' for a newline. +# Example: "Welcome to John's Server!@This server is proud to be powered by Trinity Core." # Default: "Welcome to a Trinity Core server." Motd = "Welcome to a Trinity Core server."