Core: Pass by const reference for simple objects replaced with pass by value
This commit is contained in:
@@ -740,10 +740,10 @@ class Creature : public Unit, public GridObject<Creature>
|
||||
class AssistDelayEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
AssistDelayEvent(const uint64& victim, Unit& owner) : BasicEvent(), m_victim(victim), m_owner(owner) { }
|
||||
AssistDelayEvent(const uint64 victim, Unit& owner) : BasicEvent(), m_victim(victim), m_owner(owner) { }
|
||||
|
||||
bool Execute(uint64 e_time, uint32 p_time);
|
||||
void AddAssistant(const uint64& guid) { m_assistants.push_back(guid); }
|
||||
void AddAssistant(const uint64 guid) { m_assistants.push_back(guid); }
|
||||
private:
|
||||
AssistDelayEvent();
|
||||
|
||||
|
||||
@@ -850,7 +850,7 @@ void Object::UpdateUInt32Value(uint16 index, uint32 value)
|
||||
m_uint32Values[ index ] = value;
|
||||
}
|
||||
|
||||
void Object::SetUInt64Value(uint16 index, const uint64 &value)
|
||||
void Object::SetUInt64Value(uint16 index, const uint64 value)
|
||||
{
|
||||
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, true));
|
||||
if (*((uint64*)&(m_uint32Values[ index ])) != value)
|
||||
@@ -869,7 +869,7 @@ void Object::SetUInt64Value(uint16 index, const uint64 &value)
|
||||
}
|
||||
}
|
||||
|
||||
bool Object::AddUInt64Value(uint16 index, const uint64 &value)
|
||||
bool Object::AddUInt64Value(uint16 index, const uint64 value)
|
||||
{
|
||||
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index , true));
|
||||
if (value && !*((uint64*)&(m_uint32Values[index])))
|
||||
@@ -890,7 +890,7 @@ bool Object::AddUInt64Value(uint16 index, const uint64 &value)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Object::RemoveUInt64Value(uint16 index, const uint64 &value)
|
||||
bool Object::RemoveUInt64Value(uint16 index, const uint64 value)
|
||||
{
|
||||
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index , true));
|
||||
if (value && *((uint64*)&(m_uint32Values[index])) == value)
|
||||
|
||||
@@ -124,7 +124,7 @@ class Object
|
||||
public:
|
||||
virtual ~Object ();
|
||||
|
||||
const bool& IsInWorld() const { return m_inWorld; }
|
||||
bool IsInWorld() const { return m_inWorld; }
|
||||
virtual void AddToWorld()
|
||||
{
|
||||
if (m_inWorld)
|
||||
@@ -149,7 +149,7 @@ class Object
|
||||
ClearUpdateMask(true);
|
||||
}
|
||||
|
||||
const uint64& GetGUID() const { return GetUInt64Value(0); }
|
||||
const uint64 GetGUID() const { return GetUInt64Value(0); }
|
||||
uint32 GetGUIDLow() const { return GUID_LOPART(GetUInt64Value(0)); }
|
||||
uint32 GetGUIDMid() const { return GUID_ENPART(GetUInt64Value(0)); }
|
||||
uint32 GetGUIDHigh() const { return GUID_HIPART(GetUInt64Value(0)); }
|
||||
@@ -175,13 +175,13 @@ class Object
|
||||
return m_int32Values[ index ];
|
||||
}
|
||||
|
||||
const uint32& GetUInt32Value(uint16 index) const
|
||||
const uint32 GetUInt32Value(uint16 index) const
|
||||
{
|
||||
ASSERT(index < m_valuesCount || PrintIndexError(index , false));
|
||||
return m_uint32Values[ index ];
|
||||
}
|
||||
|
||||
const uint64& GetUInt64Value(uint16 index) const
|
||||
const uint64 GetUInt64Value(uint16 index) const
|
||||
{
|
||||
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index , false));
|
||||
return *((uint64*)&(m_uint32Values[ index ]));
|
||||
@@ -210,7 +210,7 @@ class Object
|
||||
void SetInt32Value(uint16 index, int32 value);
|
||||
void SetUInt32Value(uint16 index, uint32 value);
|
||||
void UpdateUInt32Value(uint16 index, uint32 value);
|
||||
void SetUInt64Value(uint16 index, const uint64 &value);
|
||||
void SetUInt64Value(uint16 index, const uint64 value);
|
||||
void SetFloatValue(uint16 index, float value);
|
||||
void SetByteValue(uint16 index, uint8 offset, uint8 value);
|
||||
void SetUInt16Value(uint16 index, uint8 offset, uint16 value);
|
||||
@@ -218,8 +218,8 @@ class Object
|
||||
void SetStatFloatValue(uint16 index, float value);
|
||||
void SetStatInt32Value(uint16 index, int32 value);
|
||||
|
||||
bool AddUInt64Value(uint16 index, const uint64 &value);
|
||||
bool RemoveUInt64Value(uint16 index, const uint64 &value);
|
||||
bool AddUInt64Value(uint16 index, const uint64 value);
|
||||
bool RemoveUInt64Value(uint16 index, const uint64 value);
|
||||
|
||||
void ApplyModUInt32Value(uint16 index, int32 val, bool apply);
|
||||
void ApplyModInt32Value(uint16 index, int32 val, bool apply);
|
||||
|
||||
@@ -34,7 +34,7 @@ void UpdateData::AddOutOfRangeGUID(std::set<uint64>& guids)
|
||||
m_outOfRangeGUIDs.insert(guids.begin(), guids.end());
|
||||
}
|
||||
|
||||
void UpdateData::AddOutOfRangeGUID(const uint64 &guid)
|
||||
void UpdateData::AddOutOfRangeGUID(const uint64 guid)
|
||||
{
|
||||
m_outOfRangeGUIDs.insert(guid);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class UpdateData
|
||||
UpdateData();
|
||||
|
||||
void AddOutOfRangeGUID(std::set<uint64>& guids);
|
||||
void AddOutOfRangeGUID(const uint64 &guid);
|
||||
void AddOutOfRangeGUID(const uint64 guid);
|
||||
void AddUpdateBlock(const ByteBuffer &block);
|
||||
bool BuildPacket(WorldPacket* packet);
|
||||
bool HasData() { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
|
||||
|
||||
@@ -215,7 +215,7 @@ class Pet : public Guardian
|
||||
|
||||
uint32 m_usedTalentCount;
|
||||
|
||||
const uint64& GetAuraUpdateMaskForRaid() const { return m_auraRaidUpdateMask; }
|
||||
const uint64 GetAuraUpdateMaskForRaid() const { return m_auraRaidUpdateMask; }
|
||||
void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); }
|
||||
void ResetAuraUpdateMaskForRaid() { m_auraRaidUpdateMask = 0; }
|
||||
|
||||
|
||||
@@ -1537,13 +1537,13 @@ class Player : public Unit, public GridObject<Player>
|
||||
return m_RewardedQuests.find(quest_id) != m_RewardedQuests.end();
|
||||
}
|
||||
|
||||
const uint64& GetSelection() const { return m_curSelection; }
|
||||
const uint64 GetSelection() const { return m_curSelection; }
|
||||
Unit *GetSelectedUnit() const;
|
||||
Player *GetSelectedPlayer() const;
|
||||
void SetSelection(const uint64 &guid) { m_curSelection = guid; SetUInt64Value(UNIT_FIELD_TARGET, guid); }
|
||||
void SetSelection(const uint64 guid) { m_curSelection = guid; SetUInt64Value(UNIT_FIELD_TARGET, guid); }
|
||||
|
||||
uint8 GetComboPoints() { return m_comboPoints; }
|
||||
const uint64& GetComboTarget() const { return m_comboTarget; }
|
||||
const uint64 GetComboTarget() const { return m_comboTarget; }
|
||||
|
||||
void AddComboPoints(Unit* target, int8 count, Spell* spell = NULL);
|
||||
void GainSpellComboPoints(int8 count);
|
||||
@@ -1874,8 +1874,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
void UpdateManaRegen();
|
||||
void UpdateRuneRegen(RuneType rune);
|
||||
|
||||
const uint64& GetLootGUID() const { return m_lootGuid; }
|
||||
void SetLootGUID(const uint64 &guid) { m_lootGuid = guid; }
|
||||
const uint64 GetLootGUID() const { return m_lootGuid; }
|
||||
void SetLootGUID(const uint64 guid) { m_lootGuid = guid; }
|
||||
|
||||
void RemovedInsignia(Player* looterPlr);
|
||||
|
||||
@@ -2378,7 +2378,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
uint8 GetSubGroup() const { return m_group.getSubGroup(); }
|
||||
uint32 GetGroupUpdateFlag() const { return m_groupUpdateMask; }
|
||||
void SetGroupUpdateFlag(uint32 flag) { m_groupUpdateMask |= flag; }
|
||||
const uint64& GetAuraUpdateMaskForRaid() const { return m_auraRaidUpdateMask; }
|
||||
const uint64 GetAuraUpdateMaskForRaid() const { return m_auraRaidUpdateMask; }
|
||||
void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); }
|
||||
Player* GetNextRandomRaidMember(float radius);
|
||||
PartyResult CanUninviteFromGroup() const;
|
||||
|
||||
Reference in New Issue
Block a user