mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10509] Fix some "foo initialized after bar" gcc warnings and remove some unused variables.
This commit is contained in:
parent
8ccf9c7464
commit
47397ff19b
10 changed files with 28 additions and 35 deletions
|
|
@ -32,7 +32,7 @@ typedef std::map<uint32,uint32> AreaFlagByMapID;
|
||||||
|
|
||||||
struct WMOAreaTableTripple
|
struct WMOAreaTableTripple
|
||||||
{
|
{
|
||||||
WMOAreaTableTripple(int32 r, int32 a, int32 g) : rootId(r), adtId(a), groupId(g)
|
WMOAreaTableTripple(int32 r, int32 a, int32 g) : groupId(g), rootId(r), adtId(a)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -751,8 +751,6 @@ void Group::StartLootRool(Creature* lootTarget, LootMethod method, Loot* loot, u
|
||||||
|
|
||||||
LootItem const& lootItem = loot->items[itemSlot];
|
LootItem const& lootItem = loot->items[itemSlot];
|
||||||
|
|
||||||
ItemPrototype const* item = ObjectMgr::GetItemPrototype(lootItem.itemid);
|
|
||||||
|
|
||||||
Roll* r = new Roll(lootTarget->GetGUID(), method, lootItem);
|
Roll* r = new Roll(lootTarget->GetGUID(), method, lootItem);
|
||||||
|
|
||||||
//a vector is filled with only near party members
|
//a vector is filled with only near party members
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,10 @@ char const* petTypeSuffix[MAX_PET_TYPE] =
|
||||||
};
|
};
|
||||||
|
|
||||||
Pet::Pet(PetType type) :
|
Pet::Pet(PetType type) :
|
||||||
Creature(CREATURE_SUBTYPE_PET), m_removed(false), m_petType(type), m_happinessTimer(7500), m_duration(0), m_resetTalentsCost(0),
|
Creature(CREATURE_SUBTYPE_PET),
|
||||||
m_bonusdamage(0), m_resetTalentsTime(0), m_usedTalentCount(0), m_auraUpdateMask(0), m_loading(false),
|
m_resetTalentsCost(0), m_resetTalentsTime(0), m_usedTalentCount(0),
|
||||||
|
m_removed(false), m_happinessTimer(7500), m_petType(type), m_duration(0),
|
||||||
|
m_bonusdamage(0), m_auraUpdateMask(0), m_loading(false),
|
||||||
m_declinedname(NULL), m_petModeFlags(PET_MODE_DEFAULT)
|
m_declinedname(NULL), m_petModeFlags(PET_MODE_DEFAULT)
|
||||||
{
|
{
|
||||||
m_name = "Pet";
|
m_name = "Pet";
|
||||||
|
|
@ -1142,7 +1144,7 @@ void Pet::_SaveSpells()
|
||||||
void Pet::_LoadAuras(uint32 timediff)
|
void Pet::_LoadAuras(uint32 timediff)
|
||||||
{
|
{
|
||||||
RemoveAllAuras();
|
RemoveAllAuras();
|
||||||
|
|
||||||
QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,maxduration0,maxduration1,maxduration2,remaintime0,remaintime1,remaintime2,effIndexMask FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
|
QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,maxduration0,maxduration1,maxduration2,remaintime0,remaintime1,remaintime2,effIndexMask FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
|
|
@ -1210,7 +1212,7 @@ void Pet::_LoadAuras(uint32 timediff)
|
||||||
aura->SetLoadedState(damage[i], maxduration[i], remaintime[i]);
|
aura->SetLoadedState(damage[i], maxduration[i], remaintime[i]);
|
||||||
holder->AddAura(aura, SpellEffectIndex(i));
|
holder->AddAura(aura, SpellEffectIndex(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!holder->IsEmptyHolder())
|
if (!holder->IsEmptyHolder())
|
||||||
{
|
{
|
||||||
holder->SetLoadedState(caster_guid, ObjectGuid(HIGHGUID_ITEM, item_lowguid), stackcount, remaincharges);
|
holder->SetLoadedState(caster_guid, ObjectGuid(HIGHGUID_ITEM, item_lowguid), stackcount, remaincharges);
|
||||||
|
|
@ -1586,9 +1588,6 @@ bool Pet::resetTalents(bool no_cost)
|
||||||
|
|
||||||
Player *player = (Player *)owner;
|
Player *player = (Player *)owner;
|
||||||
|
|
||||||
uint32 level = getLevel();
|
|
||||||
uint32 talentPointsForLevel = GetMaxTalentPointsForLevel(level);
|
|
||||||
|
|
||||||
if (m_usedTalentCount == 0)
|
if (m_usedTalentCount == 0)
|
||||||
{
|
{
|
||||||
UpdateFreeTalentPoints(false); // for fix if need counter
|
UpdateFreeTalentPoints(false); // for fix if need counter
|
||||||
|
|
|
||||||
|
|
@ -404,7 +404,7 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/)
|
||||||
|
|
||||||
UpdateMask Player::updateVisualBits;
|
UpdateMask Player::updateVisualBits;
|
||||||
|
|
||||||
Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputationMgr(this), m_mover(this), m_camera(this)
|
Player::Player (WorldSession *session): Unit(), m_mover(this), m_camera(this), m_achievementMgr(this), m_reputationMgr(this)
|
||||||
{
|
{
|
||||||
m_transport = 0;
|
m_transport = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -374,8 +374,8 @@ static AuraType const frozenAuraTypes[] = { SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_
|
||||||
Aura::Aura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, SpellAuraHolder *holder, Unit *target, Unit *caster, Item* castItem) :
|
Aura::Aura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, SpellAuraHolder *holder, Unit *target, Unit *caster, Item* castItem) :
|
||||||
m_spellmod(NULL),
|
m_spellmod(NULL),
|
||||||
m_timeCla(1000), m_periodicTimer(0), m_periodicTick(0), m_removeMode(AURA_REMOVE_BY_DEFAULT),
|
m_timeCla(1000), m_periodicTimer(0), m_periodicTick(0), m_removeMode(AURA_REMOVE_BY_DEFAULT),
|
||||||
m_effIndex(eff), m_spellAuraHolder(holder), m_isPersistent(false),
|
m_effIndex(eff), m_positive(false), m_isPeriodic(false), m_isAreaAura(false),
|
||||||
m_positive(false), m_isPeriodic(false), m_isAreaAura(false), m_in_use(0)
|
m_isPersistent(false), m_in_use(0), m_spellAuraHolder(holder)
|
||||||
{
|
{
|
||||||
MANGOS_ASSERT(target);
|
MANGOS_ASSERT(target);
|
||||||
|
|
||||||
|
|
@ -386,7 +386,6 @@ m_positive(false), m_isPeriodic(false), m_isAreaAura(false), m_in_use(0)
|
||||||
bool isPassive = IsPassiveSpell(GetSpellProto());
|
bool isPassive = IsPassiveSpell(GetSpellProto());
|
||||||
bool isPermanent = false;
|
bool isPermanent = false;
|
||||||
m_positive = IsPositiveEffect(spellproto->Id, m_effIndex);
|
m_positive = IsPositiveEffect(spellproto->Id, m_effIndex);
|
||||||
uint64 caster_guid = !caster ? target->GetGUID() : caster->GetGUID();
|
|
||||||
|
|
||||||
m_applyTime = time(NULL);
|
m_applyTime = time(NULL);
|
||||||
|
|
||||||
|
|
@ -6690,7 +6689,7 @@ void Aura::PeriodicTick()
|
||||||
|
|
||||||
uint32 absorbHeal = 0;
|
uint32 absorbHeal = 0;
|
||||||
pCaster->CalculateHealAbsorb(heal, &absorbHeal);
|
pCaster->CalculateHealAbsorb(heal, &absorbHeal);
|
||||||
|
|
||||||
int32 gain = pCaster->DealHeal(pCaster, heal - absorbHeal, spellProto, false, absorbHeal);
|
int32 gain = pCaster->DealHeal(pCaster, heal - absorbHeal, spellProto, false, absorbHeal);
|
||||||
pCaster->getHostileRefManager().threatAssist(pCaster, gain * 0.5f, spellProto);
|
pCaster->getHostileRefManager().threatAssist(pCaster, gain * 0.5f, spellProto);
|
||||||
break;
|
break;
|
||||||
|
|
@ -7791,10 +7790,11 @@ bool Aura::IsLastAuraOnHolder()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpellAuraHolder::SpellAuraHolder(SpellEntry const* spellproto, Unit *target, WorldObject *caster, Item *castItem) : m_caster_guid(0), m_target(target),
|
SpellAuraHolder::SpellAuraHolder(SpellEntry const* spellproto, Unit *target, WorldObject *caster, Item *castItem) :
|
||||||
m_castItemGuid(castItem?castItem->GetGUID():0), m_permanent(false),
|
m_target(target), m_caster_guid(0), m_castItemGuid(castItem?castItem->GetGUID():0),
|
||||||
m_isRemovedOnShapeLost(true), m_in_use(0), m_deleted(false), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE), m_auraSlot(MAX_AURAS),
|
m_auraSlot(MAX_AURAS), m_auraFlags(AFLAG_NONE), m_auraLevel(1), m_procCharges(0),
|
||||||
m_auraFlags(AFLAG_NONE), m_auraLevel(1), m_procCharges(0), m_stackAmount(1)
|
m_stackAmount(1), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE),
|
||||||
|
m_permanent(false), m_isRemovedOnShapeLost(true), m_deleted(false), m_in_use(0)
|
||||||
{
|
{
|
||||||
MANGOS_ASSERT(target);
|
MANGOS_ASSERT(target);
|
||||||
MANGOS_ASSERT(spellproto && spellproto == sSpellStore.LookupEntry( spellproto->Id ) && "`info` must be pointer to sSpellStore element");
|
MANGOS_ASSERT(spellproto && spellproto == sSpellStore.LookupEntry( spellproto->Id ) && "`info` must be pointer to sSpellStore element");
|
||||||
|
|
@ -8979,7 +8979,7 @@ bool SpellAuraHolder::IsPositive() const
|
||||||
bool SpellAuraHolder::IsEmptyHolder() const
|
bool SpellAuraHolder::IsEmptyHolder() const
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
|
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||||
if (Aura *aur = m_auras[i])
|
if (m_auras[i])
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2377,7 +2377,6 @@ void Unit::CalculateHealAbsorb(const uint32 heal, uint32 *absorb)
|
||||||
for(AuraList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && RemainingHeal > 0; ++i)
|
for(AuraList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && RemainingHeal > 0; ++i)
|
||||||
{
|
{
|
||||||
Modifier* mod = (*i)->GetModifier();
|
Modifier* mod = (*i)->GetModifier();
|
||||||
SpellEntry const* spellProto = (*i)->GetSpellProto();
|
|
||||||
|
|
||||||
// Max Amount can be absorbed by this aura
|
// Max Amount can be absorbed by this aura
|
||||||
int32 currentAbsorb = mod->m_amount;
|
int32 currentAbsorb = mod->m_amount;
|
||||||
|
|
@ -4382,7 +4381,7 @@ void Unit::RemoveAuraHolderDueToSpellByDispel(uint32 spellId, int32 stackAmount,
|
||||||
{
|
{
|
||||||
if (Aura *dot = GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000040000000000), 0x00000000, casterGUID))
|
if (Aura *dot = GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000040000000000), 0x00000000, casterGUID))
|
||||||
{
|
{
|
||||||
if(Unit* caster = dot->GetCaster())
|
if (dot->GetCaster())
|
||||||
{
|
{
|
||||||
// use clean value for initial damage
|
// use clean value for initial damage
|
||||||
int32 bp0 = dot->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1);
|
int32 bp0 = dot->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1);
|
||||||
|
|
@ -4689,8 +4688,6 @@ void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEff
|
||||||
|
|
||||||
void Unit::RemoveAura(Aura *Aur, AuraRemoveMode mode)
|
void Unit::RemoveAura(Aura *Aur, AuraRemoveMode mode)
|
||||||
{
|
{
|
||||||
SpellEntry const* AurSpellInfo = Aur->GetSpellProto();
|
|
||||||
|
|
||||||
// remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order)
|
// remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order)
|
||||||
if (Aur->GetModifier()->m_auraname < TOTAL_AURAS)
|
if (Aur->GetModifier()->m_auraname < TOTAL_AURAS)
|
||||||
{
|
{
|
||||||
|
|
@ -9621,7 +9618,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SpellProcEventEntry const *spellProcEvent = i->spellProcEvent;
|
SpellProcEventEntry const *spellProcEvent = i->spellProcEvent;
|
||||||
SpellEntry const *spellInfo = triggeredByHolder->GetSpellProto();
|
|
||||||
bool useCharges = triggeredByHolder->GetAuraCharges() > 0;
|
bool useCharges = triggeredByHolder->GetAuraCharges() > 0;
|
||||||
bool procSuccess = true;
|
bool procSuccess = true;
|
||||||
bool anyAuraProc = false;
|
bool anyAuraProc = false;
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@
|
||||||
/// WorldSession constructor
|
/// WorldSession constructor
|
||||||
WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
|
WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
|
||||||
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
|
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
|
||||||
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion),
|
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion), _logoutTime(0),
|
||||||
|
m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_playerSave(false),
|
||||||
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(sObjectMgr.GetIndexForLocale(locale)),
|
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(sObjectMgr.GetIndexForLocale(locale)),
|
||||||
_logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_playerSave(false),
|
|
||||||
m_latency(0), m_tutorialState(TUTORIALDATA_UNCHANGED)
|
m_latency(0), m_tutorialState(TUTORIALDATA_UNCHANGED)
|
||||||
{
|
{
|
||||||
if (sock)
|
if (sock)
|
||||||
|
|
@ -884,4 +884,4 @@ void WorldSession::ExecuteOpcode( OpcodeHandler const& opHandle, WorldPacket* pa
|
||||||
|
|
||||||
if (packet->rpos() < packet->wpos() && sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
|
if (packet->rpos() < packet->wpos() && sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
|
||||||
LogUnprocessedTail(packet);
|
LogUnprocessedTail(packet);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,8 @@ struct ClientPktHeader
|
||||||
|
|
||||||
WorldSocket::WorldSocket (void) :
|
WorldSocket::WorldSocket (void) :
|
||||||
WorldHandler (),
|
WorldHandler (),
|
||||||
|
m_LastPingTime (ACE_Time_Value::zero),
|
||||||
|
m_OverSpeedPings (0),
|
||||||
m_Session (0),
|
m_Session (0),
|
||||||
m_RecvWPct (0),
|
m_RecvWPct (0),
|
||||||
m_RecvPct (),
|
m_RecvPct (),
|
||||||
|
|
@ -105,9 +107,7 @@ m_Header (sizeof (ClientPktHeader)),
|
||||||
m_OutBuffer (0),
|
m_OutBuffer (0),
|
||||||
m_OutBufferSize (65536),
|
m_OutBufferSize (65536),
|
||||||
m_OutActive (false),
|
m_OutActive (false),
|
||||||
m_Seed (static_cast<uint32> (rand32 ())),
|
m_Seed (static_cast<uint32> (rand32 ()))
|
||||||
m_OverSpeedPings (0),
|
|
||||||
m_LastPingTime (ACE_Time_Value::zero)
|
|
||||||
{
|
{
|
||||||
reference_counting_policy ().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
|
reference_counting_policy ().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,9 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ReactorRunnable () :
|
ReactorRunnable () :
|
||||||
m_ThreadId (-1),
|
m_Reactor (0),
|
||||||
m_Connections (0),
|
m_Connections (0),
|
||||||
m_Reactor (0)
|
m_ThreadId (-1)
|
||||||
{
|
{
|
||||||
ACE_Reactor_Impl* imp = 0;
|
ACE_Reactor_Impl* imp = 0;
|
||||||
|
|
||||||
|
|
@ -207,8 +207,8 @@ class ReactorRunnable : protected ACE_Task_Base
|
||||||
};
|
};
|
||||||
|
|
||||||
WorldSocketMgr::WorldSocketMgr () :
|
WorldSocketMgr::WorldSocketMgr () :
|
||||||
m_NetThreadsCount (0),
|
|
||||||
m_NetThreads (0),
|
m_NetThreads (0),
|
||||||
|
m_NetThreadsCount (0),
|
||||||
m_SockOutKBuff (-1),
|
m_SockOutKBuff (-1),
|
||||||
m_SockOutUBuff (65536),
|
m_SockOutUBuff (65536),
|
||||||
m_UseNoDelay (true),
|
m_UseNoDelay (true),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10508"
|
#define REVISION_NR "10509"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue