Skip to content

Commit 49bc69a

Browse files
committed
Core/Misc: Remove unneccessary structure packing and one unused enum
1 parent e761a00 commit 49bc69a

File tree

3 files changed

+5
-28
lines changed

3 files changed

+5
-28
lines changed

src/server/game/Entities/Creature/CreatureData.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,6 @@ struct TC_GAME_API CreatureTemplate
560560
WorldPacket BuildQueryData(LocaleConstant loc, Difficulty difficulty) const;
561561
};
562562

563-
#pragma pack(push, 1)
564-
565563
// Defines base stats for creatures (used to calculate HP/mana/armor/attackpower/rangedattackpower/all damage).
566564
struct TC_GAME_API CreatureBaseStats
567565
{
@@ -626,17 +624,6 @@ struct CreatureSummonedData
626624
Optional<std::vector<uint32>> DespawnOnQuestsRemoved;
627625
};
628626

629-
enum InhabitTypeValues
630-
{
631-
INHABIT_GROUND = 1,
632-
INHABIT_WATER = 2,
633-
INHABIT_AIR = 4,
634-
INHABIT_ROOT = 8,
635-
INHABIT_ANYWHERE = INHABIT_GROUND | INHABIT_WATER | INHABIT_AIR | INHABIT_ROOT
636-
};
637-
638-
#pragma pack(pop)
639-
640627
// `creature_addon` table
641628
struct CreatureAddon
642629
{

src/server/game/Globals/ObjectMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,7 @@ void ObjectMgr::LoadTempSummons()
20842084

20852085
data.time = Milliseconds(fields[9].GetUInt32());
20862086

2087-
TempSummonGroupKey key(summonerId, summonerType, group);
2087+
TempSummonGroupKey key{ .SummonerEntry = summonerId, .Type = summonerType, .SummonGroup = group };
20882088
_tempSummonDataStore[key].push_back(data);
20892089

20902090
++count;

src/server/game/Globals/ObjectMgr.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,14 @@ enum SummonerType
7171
SUMMONER_TYPE_MAP = 2
7272
};
7373

74-
#pragma pack(push, 1)
75-
7674
/// Key for storing temp summon data in TempSummonDataContainer
7775
struct TempSummonGroupKey
7876
{
79-
TempSummonGroupKey(uint32 summonerEntry, SummonerType summonerType, uint8 group)
80-
: _summonerEntry(summonerEntry), _summonerType(summonerType), _summonGroup(group)
81-
{
82-
}
83-
8477
std::strong_ordering operator<=>(TempSummonGroupKey const& right) const = default;
8578

86-
private:
87-
uint32 _summonerEntry; ///< Summoner's entry
88-
SummonerType _summonerType; ///< Summoner's type, see SummonerType for available types
89-
uint8 _summonGroup; ///< Summon's group id
79+
uint32 SummonerEntry; ///< Summoner's entry
80+
SummonerType Type; ///< Summoner's type, see SummonerType for available types
81+
uint8 SummonGroup; ///< Summon's group id
9082
};
9183

9284
/// Stores data for temp summons
@@ -98,8 +90,6 @@ struct TempSummonData
9890
Milliseconds time; ///< Despawn time, usable only with certain temp summon types
9991
};
10092

101-
#pragma pack(pop)
102-
10393
// DB scripting commands
10494
enum ScriptCommands
10595
{
@@ -1515,7 +1505,7 @@ class TC_GAME_API ObjectMgr
15151505
*/
15161506
std::vector<TempSummonData> const* GetSummonGroup(uint32 summonerId, SummonerType summonerType, uint8 group) const
15171507
{
1518-
TempSummonDataContainer::const_iterator itr = _tempSummonDataStore.find(TempSummonGroupKey(summonerId, summonerType, group));
1508+
auto itr = _tempSummonDataStore.find({ .SummonerEntry = summonerId, .Type = summonerType, .SummonGroup = group });
15191509
if (itr != _tempSummonDataStore.end())
15201510
return &itr->second;
15211511

0 commit comments

Comments
 (0)