mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Misc: Remove unneccessary structure packing and one unused enum
This commit is contained in:
@@ -560,8 +560,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
|
||||
{
|
||||
@@ -626,17 +624,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
|
||||
{
|
||||
|
||||
@@ -2084,7 +2084,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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
@@ -1515,7 +1505,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user