mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[7114] Code cleanups.
Remove redundant `inline` for in-class function definitions. Fixed float -> int implicit casts.
This commit is contained in:
parent
9fba64aeae
commit
9e590f7ceb
22 changed files with 82 additions and 83 deletions
|
|
@ -74,12 +74,12 @@ class MANGOS_DLL_DECL NGrid
|
|||
const GridType& operator()(unsigned short x, unsigned short y) const { return i_cells[x][y]; }
|
||||
GridType& operator()(unsigned short x, unsigned short y) { return i_cells[x][y]; }
|
||||
|
||||
inline const uint32& GetGridId(void) const { return i_gridId; }
|
||||
inline void SetGridId(const uint32 id) const { i_gridId = id; }
|
||||
inline grid_state_t GetGridState(void) const { return i_cellstate; }
|
||||
inline void SetGridState(grid_state_t s) { i_cellstate = s; }
|
||||
inline int32 getX() const { return i_x; }
|
||||
inline int32 getY() const { return i_y; }
|
||||
const uint32& GetGridId(void) const { return i_gridId; }
|
||||
void SetGridId(const uint32 id) const { i_gridId = id; }
|
||||
grid_state_t GetGridState(void) const { return i_cellstate; }
|
||||
void SetGridState(grid_state_t s) { i_cellstate = s; }
|
||||
int32 getX() const { return i_x; }
|
||||
int32 getY() const { return i_y; }
|
||||
|
||||
void link(GridRefManager<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES, ThreadModel> >* pTo)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace MaNGOS
|
|||
class MANGOS_DLL_DECL ObjectLifeTime
|
||||
{
|
||||
public:
|
||||
inline static void ScheduleCall(void (*destroyer)() )
|
||||
static void ScheduleCall(void (*destroyer)() )
|
||||
{
|
||||
at_exit( destroyer );
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ namespace MaNGOS
|
|||
};
|
||||
|
||||
template <class T>
|
||||
inline void ObjectLifeTime<T>::OnDeadReference(void)// We don't handle Dead Reference for now
|
||||
void ObjectLifeTime<T>::OnDeadReference(void) // We don't handle Dead Reference for now
|
||||
{
|
||||
throw std::runtime_error("Dead Reference");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ template <class TO, class FROM> class Reference : public LinkedListElement
|
|||
virtual ~Reference() {}
|
||||
|
||||
// Create new link
|
||||
inline void link(TO* toObj, FROM* fromObj)
|
||||
void link(TO* toObj, FROM* fromObj)
|
||||
{
|
||||
assert(fromObj); // fromObj MUST not be NULL
|
||||
if(isValid())
|
||||
|
|
@ -57,16 +57,16 @@ template <class TO, class FROM> class Reference : public LinkedListElement
|
|||
|
||||
// We don't need the reference anymore. Call comes from the refFrom object
|
||||
// Tell our refTo object, that the link is cut
|
||||
inline void unlink() { targetObjectDestroyLink(); delink(); iRefTo = NULL; iRefFrom = NULL; }
|
||||
void unlink() { targetObjectDestroyLink(); delink(); iRefTo = NULL; iRefFrom = NULL; }
|
||||
|
||||
// Link is invalid due to destruction of referenced target object. Call comes from the refTo object
|
||||
// Tell our refFrom object, that the link is cut
|
||||
inline void invalidate() // the iRefFrom MUST remain!!
|
||||
void invalidate() // the iRefFrom MUST remain!!
|
||||
{
|
||||
sourceObjectDestroyLink(); delink(); iRefTo = NULL;
|
||||
}
|
||||
|
||||
inline bool isValid() const // Only check the iRefTo
|
||||
bool isValid() const // Only check the iRefTo
|
||||
{
|
||||
return iRefTo != NULL;
|
||||
}
|
||||
|
|
@ -81,10 +81,10 @@ template <class TO, class FROM> class Reference : public LinkedListElement
|
|||
Reference<TO,FROM> * nocheck_prev() { return((Reference<TO,FROM> *) LinkedListElement::nocheck_prev()); }
|
||||
Reference<TO,FROM> const * nocheck_prev() const { return((Reference<TO,FROM> const *) LinkedListElement::nocheck_prev()); }
|
||||
|
||||
inline TO* operator ->() const { return iRefTo; }
|
||||
inline TO* getTarget() const { return iRefTo; }
|
||||
TO* operator ->() const { return iRefTo; }
|
||||
TO* getTarget() const { return iRefTo; }
|
||||
|
||||
inline FROM* getSource() const { return iRefFrom; }
|
||||
FROM* getSource() const { return iRefFrom; }
|
||||
};
|
||||
|
||||
//=====================================================
|
||||
|
|
|
|||
|
|
@ -205,8 +205,8 @@ class BattleGroundMgr
|
|||
|
||||
uint32 CreateBattleGround(uint32 bgTypeId, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO);
|
||||
|
||||
inline void AddBattleGround(uint32 ID, BattleGround* BG) { m_BattleGrounds[ID] = BG; };
|
||||
inline void RemoveBattleGround(uint32 instanceID) { m_BattleGrounds.erase(instanceID); }
|
||||
void AddBattleGround(uint32 ID, BattleGround* BG) { m_BattleGrounds[ID] = BG; };
|
||||
void RemoveBattleGround(uint32 instanceID) { m_BattleGrounds.erase(instanceID); }
|
||||
|
||||
void CreateInitialBattleGrounds();
|
||||
|
||||
|
|
|
|||
|
|
@ -91,13 +91,13 @@ struct MANGOS_DLL_DECL Cell
|
|||
y = data.Part.grid_y*MAX_NUMBER_OF_CELLS + data.Part.cell_y;
|
||||
}
|
||||
|
||||
inline bool DiffCell(const Cell &cell) const
|
||||
bool DiffCell(const Cell &cell) const
|
||||
{
|
||||
return( data.Part.cell_x != cell.data.Part.cell_x ||
|
||||
data.Part.cell_y != cell.data.Part.cell_y );
|
||||
}
|
||||
|
||||
inline bool DiffGrid(const Cell &cell) const
|
||||
bool DiffGrid(const Cell &cell) const
|
||||
{
|
||||
return( data.Part.grid_x != cell.data.Part.grid_x ||
|
||||
data.Part.grid_y != cell.data.Part.grid_y );
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||
|
||||
template<class LOCK_TYPE, class T, class CONTAINER> void Visit(const CellLock<LOCK_TYPE> &cell, TypeContainerVisitor<T, CONTAINER> &visitor);
|
||||
|
||||
inline bool IsRemovalGrid(float x, float y) const
|
||||
bool IsRemovalGrid(float x, float y) const
|
||||
{
|
||||
GridPair p = MaNGOS::ComputeGridPair(x, y);
|
||||
return( !getNGrid(p.x_coord, p.y_coord) || getNGrid(p.x_coord, p.y_coord)->GetGridState() == GRID_STATE_REMOVAL );
|
||||
|
|
@ -291,7 +291,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||
bool isGridObjectDataLoaded(uint32 x, uint32 y) const { return getNGrid(x,y)->isGridObjectDataLoaded(); }
|
||||
void setGridObjectDataLoaded(bool pLoaded, uint32 x, uint32 y) { getNGrid(x,y)->setGridObjectDataLoaded(pLoaded); }
|
||||
|
||||
inline void setNGrid(NGridType* grid, uint32 x, uint32 y);
|
||||
void setNGrid(NGridType* grid, uint32 x, uint32 y);
|
||||
|
||||
protected:
|
||||
typedef MaNGOS::ObjectLevelLockable<Map, ZThread::Mutex>::Lock Guard;
|
||||
|
|
|
|||
|
|
@ -45,18 +45,18 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
|
|||
Map const* GetBaseMap(uint32 id) const { return const_cast<MapManager*>(this)->_GetBaseMap(id); }
|
||||
void DeleteInstance(uint32 mapid, uint32 instanceId);
|
||||
|
||||
inline uint16 GetAreaFlag(uint32 mapid, float x, float y, float z) const
|
||||
uint16 GetAreaFlag(uint32 mapid, float x, float y, float z) const
|
||||
{
|
||||
Map const* m = GetBaseMap(mapid);
|
||||
return m->GetAreaFlag(x, y, z);
|
||||
}
|
||||
inline uint32 GetAreaId(uint32 mapid, float x, float y, float z) { return Map::GetAreaId(GetAreaFlag(mapid, x, y, z),mapid); }
|
||||
inline uint32 GetZoneId(uint32 mapid, float x, float y, float z) { return Map::GetZoneId(GetAreaFlag(mapid, x, y, z),mapid); }
|
||||
uint32 GetAreaId(uint32 mapid, float x, float y, float z) const { return Map::GetAreaId(GetAreaFlag(mapid, x, y, z),mapid); }
|
||||
uint32 GetZoneId(uint32 mapid, float x, float y, float z) const { return Map::GetZoneId(GetAreaFlag(mapid, x, y, z),mapid); }
|
||||
|
||||
void Initialize(void);
|
||||
void Update(time_t);
|
||||
|
||||
inline void SetGridCleanUpDelay(uint32 t)
|
||||
void SetGridCleanUpDelay(uint32 t)
|
||||
{
|
||||
if( t < MIN_GRID_DELAY )
|
||||
i_gridCleanUpDelay = MIN_GRID_DELAY;
|
||||
|
|
@ -64,7 +64,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
|
|||
i_gridCleanUpDelay = t;
|
||||
}
|
||||
|
||||
inline void SetMapUpdateInterval(uint32 t)
|
||||
void SetMapUpdateInterval(uint32 t)
|
||||
{
|
||||
if( t > MIN_MAP_UPDATE_DELAY )
|
||||
t = MIN_MAP_UPDATE_DELAY;
|
||||
|
|
@ -106,7 +106,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
|
|||
|
||||
bool CanPlayerEnter(uint32 mapid, Player* player);
|
||||
void RemoveBonesFromMap(uint32 mapid, uint64 guid, float x, float y);
|
||||
inline uint32 GenerateInstanceId() { return ++i_MaxInstanceId; }
|
||||
uint32 GenerateInstanceId() { return ++i_MaxInstanceId; }
|
||||
void InitMaxInstanceId();
|
||||
|
||||
/* statistics */
|
||||
|
|
|
|||
|
|
@ -4537,7 +4537,7 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
|
|||
AuraList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
|
||||
for(AuraList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
|
||||
if ((*i)->GetMiscValue() & (1<<cr))
|
||||
amount += GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetModifier()->m_amount / 100.0f;
|
||||
amount += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetModifier()->m_amount / 100.0f);
|
||||
if (amount < 0)
|
||||
amount = 0;
|
||||
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr, uint32(amount));
|
||||
|
|
@ -6503,7 +6503,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
|||
uint32 level = ((getLevel() > ssd->MaxLevel) ? ssd->MaxLevel : getLevel());
|
||||
if(ScalingStatValuesEntry const *ssv = sScalingStatValuesStore.LookupEntry(level))
|
||||
{
|
||||
int multiplier = ssv->Multiplier[proto->GetScalingStatValuesColumn()];
|
||||
uint32 multiplier = ssv->Multiplier[proto->GetScalingStatValuesColumn()];
|
||||
val = (multiplier * modifier) / 10000;
|
||||
}
|
||||
}
|
||||
|
|
@ -6512,7 +6512,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
|||
else
|
||||
{
|
||||
statType = proto->ItemStat[i].ItemStatType;
|
||||
val = float(proto->ItemStat[i].ItemStatValue);
|
||||
val = proto->ItemStat[i].ItemStatValue;
|
||||
}
|
||||
|
||||
if(val == 0)
|
||||
|
|
@ -14264,12 +14264,12 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
// clear charm/summon related fields
|
||||
SetCharm(NULL);
|
||||
SetPet(NULL);
|
||||
SetCharmerGUID(NULL);
|
||||
SetOwnerGUID(NULL);
|
||||
SetCreatorGUID(NULL);
|
||||
SetCharmerGUID(0);
|
||||
SetOwnerGUID(0);
|
||||
SetCreatorGUID(0);
|
||||
|
||||
// reset some aura modifiers before aura apply
|
||||
SetFarSight(NULL);
|
||||
SetFarSightGUID(0);
|
||||
SetUInt32Value(PLAYER_TRACK_CREATURES, 0 );
|
||||
SetUInt32Value(PLAYER_TRACK_RESOURCES, 0 );
|
||||
|
||||
|
|
@ -19171,7 +19171,7 @@ void Player::EnterVehicle(Vehicle *vehicle)
|
|||
vehicle->setFaction(getFaction());
|
||||
|
||||
SetCharm(vehicle); // charm
|
||||
SetFarSight(vehicle->GetGUID()); // set view
|
||||
SetFarSightGUID(vehicle->GetGUID()); // set view
|
||||
|
||||
SetClientControl(vehicle, 1); // redirect controls to vehicle
|
||||
|
||||
|
|
@ -19222,7 +19222,7 @@ void Player::ExitVehicle(Vehicle *vehicle)
|
|||
vehicle->setFaction((GetTeam() == ALLIANCE) ? vehicle->GetCreatureInfo()->faction_A : vehicle->GetCreatureInfo()->faction_H);
|
||||
|
||||
SetCharm(NULL);
|
||||
SetFarSight(NULL);
|
||||
SetFarSightGUID(0);
|
||||
|
||||
SetClientControl(vehicle, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -2064,7 +2064,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
void ExitVehicle(Vehicle *vehicle);
|
||||
|
||||
uint64 GetFarSight() const { return GetUInt64Value(PLAYER_FARSIGHT); }
|
||||
void SetFarSight(uint64 guid) { SetUInt64Value(PLAYER_FARSIGHT, guid); }
|
||||
void SetFarSightGUID(uint64 guid) { SetUInt64Value(PLAYER_FARSIGHT, guid); }
|
||||
|
||||
// Transports
|
||||
Transport * GetTransport() const { return m_transport; }
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ class Spell
|
|||
bool HaveTargetsForEffect(uint8 effect) const;
|
||||
void Delayed();
|
||||
void DelayedChannel();
|
||||
inline uint32 getState() const { return m_spellState; }
|
||||
uint32 getState() const { return m_spellState; }
|
||||
void setState(uint32 state) { m_spellState = state; }
|
||||
|
||||
void DoCreateItem(uint32 i, uint32 itemtype);
|
||||
|
|
|
|||
|
|
@ -2081,7 +2081,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
|||
( GetSpellProto()->EffectApplyAuraName[0]==1 || GetSpellProto()->EffectApplyAuraName[0]==128 ) ) )
|
||||
{
|
||||
// spells with SpellEffect=72 and aura=4: 6196, 6197, 21171, 21425
|
||||
((Player*)m_target)->SetFarSight(NULL);
|
||||
((Player*)m_target)->SetFarSightGUID(0);
|
||||
WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
|
||||
((Player*)m_target)->GetSession()->SendPacket(&data);
|
||||
return;
|
||||
|
|
@ -2967,7 +2967,7 @@ void Aura::HandleBindSight(bool apply, bool Real)
|
|||
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
((Player*)caster)->SetFarSight(apply ? m_target->GetGUID() : NULL);
|
||||
((Player*)caster)->SetFarSightGUID(apply ? m_target->GetGUID() : 0);
|
||||
}
|
||||
|
||||
void Aura::HandleFarSight(bool apply, bool Real)
|
||||
|
|
@ -2976,7 +2976,7 @@ void Aura::HandleFarSight(bool apply, bool Real)
|
|||
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
((Player*)caster)->SetFarSight(apply ? m_target->GetGUID() : NULL);
|
||||
((Player*)caster)->SetFarSightGUID(apply ? m_target->GetGUID() : 0);
|
||||
}
|
||||
|
||||
void Aura::HandleAuraTrackCreatures(bool apply, bool Real)
|
||||
|
|
@ -3083,7 +3083,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
|
|||
}
|
||||
}
|
||||
if(caster->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)caster)->SetFarSight(apply ? m_target->GetGUID() : NULL);
|
||||
((Player*)caster)->SetFarSightGUID(apply ? m_target->GetGUID() : 0);
|
||||
}
|
||||
|
||||
void Aura::HandleModPossessPet(bool apply, bool Real)
|
||||
|
|
@ -3104,7 +3104,7 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
|
|||
else
|
||||
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
|
||||
|
||||
((Player*)caster)->SetFarSight(apply ? pet->GetGUID() : NULL);
|
||||
((Player*)caster)->SetFarSightGUID(apply ? pet->GetGUID() : NULL);
|
||||
((Player*)caster)->SetCharm(apply ? pet : NULL);
|
||||
((Player*)caster)->SetClientControl(pet, apply ? 1 : 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -3564,7 +3564,7 @@ void Spell::EffectAddFarsight(uint32 i)
|
|||
m_caster->AddDynObject(dynObj);
|
||||
dynObj->GetMap()->Add(dynObj);
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)m_caster)->SetFarSight(dynObj->GetGUID());
|
||||
((Player*)m_caster)->SetFarSightGUID(dynObj->GetGUID());
|
||||
}
|
||||
|
||||
void Spell::EffectSummonWild(uint32 i)
|
||||
|
|
|
|||
|
|
@ -204,10 +204,10 @@ class MANGOS_DLL_SPEC ThreatManager
|
|||
|
||||
// methods to access the lists from the outside to do sume dirty manipulation (scriping and such)
|
||||
// I hope they are used as little as possible.
|
||||
inline std::list<HostilReference*>& getThreatList() { return iThreatContainer.getThreatList(); }
|
||||
inline std::list<HostilReference*>& getOfflieThreatList() { return iThreatOfflineContainer.getThreatList(); }
|
||||
inline ThreatContainer& getOnlineContainer() { return iThreatContainer; }
|
||||
inline ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; }
|
||||
std::list<HostilReference*>& getThreatList() { return iThreatContainer.getThreatList(); }
|
||||
std::list<HostilReference*>& getOfflieThreatList() { return iThreatOfflineContainer.getThreatList(); }
|
||||
ThreatContainer& getOnlineContainer() { return iThreatContainer; }
|
||||
ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; }
|
||||
};
|
||||
|
||||
//=================================================
|
||||
|
|
|
|||
|
|
@ -36,16 +36,16 @@ class TransportPath
|
|||
uint32 delay;
|
||||
};
|
||||
|
||||
inline void SetLength(const unsigned int sz)
|
||||
void SetLength(const unsigned int sz)
|
||||
{
|
||||
i_nodes.resize( sz );
|
||||
}
|
||||
|
||||
inline unsigned int Size(void) const { return i_nodes.size(); }
|
||||
inline bool Empty(void) const { return i_nodes.empty(); }
|
||||
inline void Resize(unsigned int sz) { i_nodes.resize(sz); }
|
||||
inline void Clear(void) { i_nodes.clear(); }
|
||||
inline PathNode* GetNodes(void) { return static_cast<PathNode *>(&i_nodes[0]); }
|
||||
unsigned int Size(void) const { return i_nodes.size(); }
|
||||
bool Empty(void) const { return i_nodes.empty(); }
|
||||
void Resize(unsigned int sz) { i_nodes.resize(sz); }
|
||||
void Clear(void) { i_nodes.clear(); }
|
||||
PathNode* GetNodes(void) { return static_cast<PathNode *>(&i_nodes[0]); }
|
||||
|
||||
PathNode& operator[](const unsigned int idx) { return i_nodes[idx]; }
|
||||
const PathNode& operator()(const unsigned int idx) const { return i_nodes[idx]; }
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@ struct MANGOS_DLL_DECL Traveller
|
|||
|
||||
operator T&(void) { return i_traveller; }
|
||||
operator const T&(void) { return i_traveller; }
|
||||
inline float GetPositionX() const { return i_traveller.GetPositionX(); }
|
||||
inline float GetPositionY() const { return i_traveller.GetPositionY(); }
|
||||
inline float GetPositionZ() const { return i_traveller.GetPositionZ(); }
|
||||
inline T& GetTraveller(void) { return i_traveller; }
|
||||
float GetPositionX() const { return i_traveller.GetPositionX(); }
|
||||
float GetPositionY() const { return i_traveller.GetPositionY(); }
|
||||
float GetPositionZ() const { return i_traveller.GetPositionZ(); }
|
||||
T& GetTraveller(void) { return i_traveller; }
|
||||
|
||||
float Speed(void) { assert(false); return 0.0f; }
|
||||
void Relocation(float x, float y, float z, float orientation) {}
|
||||
|
|
|
|||
|
|
@ -8166,8 +8166,7 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) con
|
|||
if(itr->type == effect)
|
||||
return true;
|
||||
|
||||
uint32 mechanic = spellInfo->EffectMechanic[index];
|
||||
if (mechanic)
|
||||
if(uint32 mechanic = spellInfo->EffectMechanic[index])
|
||||
{
|
||||
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
|
||||
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
|
||||
|
|
@ -8175,14 +8174,14 @@ bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) con
|
|||
return true;
|
||||
}
|
||||
|
||||
uint32 aura = spellInfo->EffectApplyAuraName[index];
|
||||
if (aura)
|
||||
if(uint32 aura = spellInfo->EffectApplyAuraName[index])
|
||||
{
|
||||
SpellImmuneList const& list = m_spellImmune[IMMUNITY_STATE];
|
||||
for(SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
|
||||
if(itr->type == aura)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,27 +34,27 @@ class UpdateMask
|
|||
delete [] mUpdateMask;
|
||||
}
|
||||
|
||||
inline void SetBit (uint32 index)
|
||||
void SetBit (uint32 index)
|
||||
{
|
||||
( (uint8 *)mUpdateMask )[ index >> 3 ] |= 1 << ( index & 0x7 );
|
||||
}
|
||||
|
||||
inline void UnsetBit (uint32 index)
|
||||
void UnsetBit (uint32 index)
|
||||
{
|
||||
( (uint8 *)mUpdateMask )[ index >> 3 ] &= (0xff ^ (1 << ( index & 0x7 ) ) );
|
||||
}
|
||||
|
||||
inline bool GetBit (uint32 index)
|
||||
bool GetBit (uint32 index) const
|
||||
{
|
||||
return ( ( (uint8 *)mUpdateMask)[ index >> 3 ] & ( 1 << ( index & 0x7 ) )) != 0;
|
||||
}
|
||||
|
||||
inline uint32 GetBlockCount() { return mBlocks; }
|
||||
inline uint32 GetLength() { return mBlocks << 2; }
|
||||
inline uint32 GetCount() { return mCount; }
|
||||
inline uint8* GetMask() { return (uint8*)mUpdateMask; }
|
||||
uint32 GetBlockCount() const { return mBlocks; }
|
||||
uint32 GetLength() const { return mBlocks << 2; }
|
||||
uint32 GetCount() const { return mCount; }
|
||||
uint8* GetMask() { return (uint8*)mUpdateMask; }
|
||||
|
||||
inline void SetCount (uint32 valuesCount)
|
||||
void SetCount (uint32 valuesCount)
|
||||
{
|
||||
if(mUpdateMask)
|
||||
delete [] mUpdateMask;
|
||||
|
|
@ -66,13 +66,13 @@ class UpdateMask
|
|||
memset(mUpdateMask, 0, mBlocks << 2);
|
||||
}
|
||||
|
||||
inline void Clear()
|
||||
void Clear()
|
||||
{
|
||||
if (mUpdateMask)
|
||||
memset(mUpdateMask, 0, mBlocks << 2);
|
||||
}
|
||||
|
||||
inline UpdateMask& operator = ( const UpdateMask& mask )
|
||||
UpdateMask& operator = ( const UpdateMask& mask )
|
||||
{
|
||||
SetCount(mask.mCount);
|
||||
memcpy(mUpdateMask, mask.mUpdateMask, mBlocks << 2);
|
||||
|
|
@ -80,21 +80,21 @@ class UpdateMask
|
|||
return *this;
|
||||
}
|
||||
|
||||
inline void operator &= ( const UpdateMask& mask )
|
||||
void operator &= ( const UpdateMask& mask )
|
||||
{
|
||||
ASSERT(mask.mCount <= mCount);
|
||||
for (uint32 i = 0; i < mBlocks; i++)
|
||||
mUpdateMask[i] &= mask.mUpdateMask[i];
|
||||
}
|
||||
|
||||
inline void operator |= ( const UpdateMask& mask )
|
||||
void operator |= ( const UpdateMask& mask )
|
||||
{
|
||||
ASSERT(mask.mCount <= mCount);
|
||||
for (uint32 i = 0; i < mBlocks; i++)
|
||||
mUpdateMask[i] |= mask.mUpdateMask[i];
|
||||
}
|
||||
|
||||
inline UpdateMask operator & ( const UpdateMask& mask ) const
|
||||
UpdateMask operator & ( const UpdateMask& mask ) const
|
||||
{
|
||||
ASSERT(mask.mCount <= mCount);
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ class UpdateMask
|
|||
return newmask;
|
||||
}
|
||||
|
||||
inline UpdateMask operator | ( const UpdateMask& mask ) const
|
||||
UpdateMask operator | ( const UpdateMask& mask ) const
|
||||
{
|
||||
ASSERT(mask.mCount <= mCount);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class MANGOS_DLL_SPEC PathMovementBase
|
|||
PathMovementBase() : i_currentNode(0) {}
|
||||
virtual ~PathMovementBase() {};
|
||||
|
||||
inline bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); }
|
||||
bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); }
|
||||
|
||||
// template pattern, not defined .. override required
|
||||
void LoadPath(T &);
|
||||
|
|
@ -135,7 +135,7 @@ public PathMovementBase<Player>
|
|||
|
||||
Path& GetPath() { return i_path; }
|
||||
uint32 GetPathAtMapEnd() const;
|
||||
inline bool HasArrived() const { return (i_currentNode >= i_path.Size()); }
|
||||
bool HasArrived() const { return (i_currentNode >= i_path.Size()); }
|
||||
void SetCurrentNodeAfterTeleport();
|
||||
void SkipCurrentNode() { ++i_currentNode; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ class MANGOS_DLL_DECL WorldLog : public MaNGOS::Singleton<WorldLog, MaNGOS::Clas
|
|||
public:
|
||||
void Initialize();
|
||||
/// Is the world logger active?
|
||||
inline bool LogWorld(void) const { return (i_file != NULL); }
|
||||
bool LogWorld(void) const { return (i_file != NULL); }
|
||||
/// %Log to the file
|
||||
inline void Log(char const *fmt, ...)
|
||||
void Log(char const *fmt, ...)
|
||||
{
|
||||
if( LogWorld() )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class CharacterHandler;
|
|||
|
||||
struct AccountData
|
||||
{
|
||||
AccountData() : Time(NULL), Data("") {}
|
||||
AccountData() : Time(0), Data("") {}
|
||||
|
||||
time_t Time;
|
||||
std::string Data;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class SqlDelayThread : public ZThread::Runnable
|
|||
SqlDelayThread(Database* db);
|
||||
|
||||
///< Put sql statement to delay queue
|
||||
inline bool Delay(SqlOperation* sql) { m_sqlQueue.add(sql); return true; }
|
||||
bool Delay(SqlOperation* sql) { m_sqlQueue.add(sql); return true; }
|
||||
|
||||
virtual void Stop(); ///< Stop event
|
||||
virtual void run(); ///< Main Thread loop
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7113"
|
||||
#define REVISION_NR "7114"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue