aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-01-16 00:24:55 +0100
committerOvahlord <dreadkiller@gmx.de>2025-01-18 00:08:50 +0100
commit3fc2699a4f021db4f1314a4316f30f79d1e2eddf (patch)
tree8ade302cd0a6046360c524c752c5cb79c56b9091 /src
parent226b430fabd43ff7d5406f816d7a86be59bcb63f (diff)
Core/Misc: Remove unneccessary structure packing and one unused enum
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/CreatureData.h13
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp2
-rw-r--r--src/server/game/Globals/ObjectMgr.h18
3 files changed, 5 insertions, 28 deletions
diff --git a/src/server/game/Entities/Creature/CreatureData.h b/src/server/game/Entities/Creature/CreatureData.h
index e3739e24a01..9861b9dcd1f 100644
--- a/src/server/game/Entities/Creature/CreatureData.h
+++ b/src/server/game/Entities/Creature/CreatureData.h
@@ -559,8 +559,6 @@ struct TC_GAME_API CreatureTemplate
WorldPacket BuildQueryData(LocaleConstant loc, Difficulty difficulty) const;
};
-#pragma pack(push, 1)
-
// Defines base stats for creatures (used to calculate HP/mana/armor/attackpower/rangedattackpower/all damage).
struct TC_GAME_API CreatureBaseStats
{
@@ -643,17 +641,6 @@ struct CreatureSummonedData
Optional<std::vector<uint32>> DespawnOnQuestsRemoved;
};
-enum InhabitTypeValues
-{
- INHABIT_GROUND = 1,
- INHABIT_WATER = 2,
- INHABIT_AIR = 4,
- INHABIT_ROOT = 8,
- INHABIT_ANYWHERE = INHABIT_GROUND | INHABIT_WATER | INHABIT_AIR | INHABIT_ROOT
-};
-
-#pragma pack(pop)
-
// `creature_addon` table
struct CreatureAddon
{
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 348937a7a19..6de875906ee 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2105,7 +2105,7 @@ void ObjectMgr::LoadTempSummons()
data.time = Milliseconds(fields[9].GetUInt32());
- TempSummonGroupKey key(summonerId, summonerType, group);
+ TempSummonGroupKey key{ .SummonerEntry = summonerId, .Type = summonerType, .SummonGroup = group };
_tempSummonDataStore[key].push_back(data);
++count;
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 72e0bfaa332..7de6017ecd8 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -71,22 +71,14 @@ enum SummonerType
SUMMONER_TYPE_MAP = 2
};
-#pragma pack(push, 1)
-
/// Key for storing temp summon data in TempSummonDataContainer
struct TempSummonGroupKey
{
- TempSummonGroupKey(uint32 summonerEntry, SummonerType summonerType, uint8 group)
- : _summonerEntry(summonerEntry), _summonerType(summonerType), _summonGroup(group)
- {
- }
-
std::strong_ordering operator<=>(TempSummonGroupKey const& right) const = default;
-private:
- uint32 _summonerEntry; ///< Summoner's entry
- SummonerType _summonerType; ///< Summoner's type, see SummonerType for available types
- uint8 _summonGroup; ///< Summon's group id
+ uint32 SummonerEntry; ///< Summoner's entry
+ SummonerType Type; ///< Summoner's type, see SummonerType for available types
+ uint8 SummonGroup; ///< Summon's group id
};
/// Stores data for temp summons
@@ -98,8 +90,6 @@ struct TempSummonData
Milliseconds time; ///< Despawn time, usable only with certain temp summon types
};
-#pragma pack(pop)
-
// DB scripting commands
enum ScriptCommands
{
@@ -1494,7 +1484,7 @@ class TC_GAME_API ObjectMgr
*/
std::vector<TempSummonData> const* GetSummonGroup(uint32 summonerId, SummonerType summonerType, uint8 group) const
{
- TempSummonDataContainer::const_iterator itr = _tempSummonDataStore.find(TempSummonGroupKey(summonerId, summonerType, group));
+ auto itr = _tempSummonDataStore.find({ .SummonerEntry = summonerId, .Type = summonerType, .SummonGroup = group });
if (itr != _tempSummonDataStore.end())
return &itr->second;