More warning removal (Some code modifications and cleanup when needed)

--HG--
branch : trunk
This commit is contained in:
Spp
2010-04-19 17:03:10 +02:00
parent f74e969a06
commit be01821050
46 changed files with 420 additions and 353 deletions
+4 -1
View File
@@ -1099,7 +1099,9 @@ WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* player)
for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED)
if (entry = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[i]))
{
entry = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[i]);
if (entry)
{
dist = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y);
if (dist < minDist)
@@ -1108,6 +1110,7 @@ WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* player)
pGraveyard = entry;
}
}
}
return pGraveyard;
}
+3 -1
View File
@@ -106,7 +106,9 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
if (instanceId)
bg = sBattleGroundMgr.GetBattleGroundThroughClientInstance(instanceId, bgTypeId);
if (!bg && !(bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId)))
if (!bg)
bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
if (!bg)
return;
// expected bracket entry
+1 -1
View File
@@ -488,7 +488,7 @@ void BattleGroundSA::DestroyGate(uint32 i, Player* pl)
if (g->GetGOValue()->building.health == 0)
{
GateStatus[i] = BG_SA_GATE_DESTROYED;
uint32 uws;
uint32 uws = 0;
switch(i)
{
case 0:
+3 -2
View File
@@ -374,9 +374,10 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
target = owner;
}
}
else if ((target = me->getVictim()))
else
{
if (target->GetTypeId() != TYPEID_PLAYER)
target = me->getVictim();
if (target && target->GetTypeId() != TYPEID_PLAYER)
if (Unit* owner = target->GetOwner())
if (owner->GetTypeId() == TYPEID_PLAYER)
target = owner;
+1 -1
View File
@@ -77,7 +77,7 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
y = owner.GetPositionY();
z = owner.GetPositionZ();
float temp_x, temp_y, angle;
float temp_x, temp_y, angle = 0;
const Map * _map = owner.GetBaseMap();
//primitive path-finding
for (uint8 i = 0; i < 18; ++i)
+1 -1
View File
@@ -913,7 +913,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
uint8 maxresul = 0;
uint64 maxguid = (*roll->playerVote.begin()).first;
Player *player;
RollVote rollvote;
RollVote rollvote = NOT_VALID;
Roll::PlayerVote::iterator itr;
for (itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
+1 -1
View File
@@ -972,7 +972,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
uint8 BankTab, BankTabSlot, AutoStore;
uint8 PlayerSlot = NULL_SLOT;
uint8 PlayerBag = NULL_BAG;
uint8 BankTabDst, BankTabSlotDst, unk2;
uint8 BankTabDst = 0, BankTabSlotDst = 0, unk2;
uint8 ToChar = 1;
uint32 ItemEntry, unk1;
uint32 AutoStoreCount = 0;
+2 -2
View File
@@ -6902,13 +6902,13 @@ bool ChatHandler::HandleServerSetClosedCommand(const char *args)
{
std::string arg = args;
if (args == "on")
if (strncmp(args, "on", 3) == 0)
{
SendSysMessage(LANG_WORLD_CLOSED);
sWorld.SetClosed(true);
return true;
}
if (args == "off")
else if (strncmp(args, "off", 4) == 0)
{
SendSysMessage(LANG_WORLD_OPENED);
sWorld.SetClosed(false);
+1 -1
View File
@@ -2628,7 +2628,7 @@ void InstanceMap::CreateInstanceData(bool load)
{
Field* fields = result->Fetch();
const char* data = fields[0].GetString();
if (data && data != "")
if (data && (strncmp(data, "", 1) == 0))
{
sLog.outDebug("Loading instance data for `%s` with id %u", objmgr.GetScriptName(i_script_id), i_InstanceId);
i_data->Load(data);
+6 -2
View File
@@ -150,8 +150,12 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player)
InstanceGroupBind *groupBind = NULL;
Group *group = player->GetGroup();
// use the player's difficulty setting (it may not be the same as the group's)
if (group && (groupBind = group->GetBoundInstance(this)))
pSave = groupBind->save;
if (group)
{
groupBind = group->GetBoundInstance(this);
if (groupBind)
pSave = groupBind->save;
}
}
if (pSave)
{
+5 -3
View File
@@ -252,7 +252,7 @@ void ObjectAccessor::AddCorpsesToGrid(GridPair const& gridpair, GridType& grid,
}
}
Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insignia*/)
{
Corpse* corpse = GetCorpseForPlayerGUID(player_guid);
if (!corpse)
@@ -266,7 +266,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
DEBUG_LOG("Deleting Corpse and spawning bones.");
Map* map = corpse->FindMap();
//Map* map = corpse->FindMap();
// remove corpse from player_guid -> corpse map
RemoveCorpse(corpse);
@@ -285,6 +285,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
delete corpse;
return NULL;
/*
Corpse* bones = NULL;
// create the bones only if the map and the grid is loaded at the corpse's location
// ignore bones creating option in case insignia
@@ -323,9 +324,10 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
delete corpse;
return bones;
*/
}
void ObjectAccessor::Update(uint32 diff)
void ObjectAccessor::Update(uint32 /*diff*/)
{
UpdateDataMapType update_players;
+6 -5
View File
@@ -3392,7 +3392,7 @@ void ObjectMgr::LoadArenaTeams()
do
{
Field *fields = result->Fetch();
//Field *fields = result->Fetch();
bar.step();
++count;
@@ -5308,7 +5308,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team)
{
bool found = false;
float dist;
float dist = 10000;
uint32 id = 0;
for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
@@ -5394,7 +5394,8 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
CreatureInfo const *mount_info = GetCreatureTemplate(mount_entry);
if (mount_info)
{
if (! (mount_id = mount_info->GetRandomValidModelId()))
mount_id = mount_info->GetRandomValidModelId();
if (!mount_id)
{
sLog.outErrorDb("No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
return false;
@@ -5539,12 +5540,12 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
// at corpse map
bool foundNear = false;
float distNear;
float distNear = 10000;
WorldSafeLocsEntry const* entryNear = NULL;
// at entrance map for corpse map
bool foundEntr = false;
float distEntr;
float distEntr = 10000;
WorldSafeLocsEntry const* entryEntr = NULL;
// some where other
+2 -2
View File
@@ -113,8 +113,8 @@ void OutdoorPvPHP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
bool OutdoorPvPHP::Update(uint32 diff)
{
bool changed = false;
if (changed = OutdoorPvP::Update(diff))
bool changed = OutdoorPvP::Update(diff);
if (changed)
{
if (m_AllianceTowersControlled == 3)
TeamApplyBuff(TEAM_ALLIANCE, AllianceBuff, HordeBuff);
+2 -2
View File
@@ -120,9 +120,9 @@ void OPvPCapturePointTF::HandlePlayerLeave(Player *plr)
bool OutdoorPvPTF::Update(uint32 diff)
{
bool changed = false;
bool changed = OutdoorPvP::Update(diff);
if (changed = OutdoorPvP::Update(diff))
if (changed)
{
if (m_AllianceTowersControlled == TF_TOWER_NUM)
{
+2 -2
View File
@@ -126,8 +126,8 @@ void OPvPCapturePointZM_Beacon::SendChangePhase()
bool OutdoorPvPZM::Update(uint32 diff)
{
bool changed = false;
if (changed = OutdoorPvP::Update(diff))
bool changed = OutdoorPvP::Update(diff);
if (changed)
{
if (m_AllianceTowersControlled == ZM_NUM_BEACONS)
m_GraveYard->SetBeaconState(ALLIANCE);
+10 -9
View File
@@ -1600,7 +1600,8 @@ bool Player::BuildEnumData(QueryResult_AutoPtr result, WorldPacket * p_data)
if (!enchantId)
continue;
if ((enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)))
enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId);
if (enchant)
break;
}
@@ -7262,7 +7263,8 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
// If set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage
if (ssv)
{
if ((extraDPS = ssv->getDPSMod(proto->ScalingStatValue)))
extraDPS = ssv->getDPSMod(proto->ScalingStatValue);
if (extraDPS)
{
float average = extraDPS * proto->Delay / 1000.0f;
minDamage = 0.7f * average;
@@ -12172,7 +12174,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
{
uint8 msg;
ItemPosCountVec sDest;
uint16 eDest;
uint16 eDest = 0;
if (IsInventoryPos(dst))
msg = CanStoreItem(dstbag, dstslot, sDest, pSrcItem, false);
else if (IsBankPos (dst))
@@ -12216,7 +12218,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
}
// impossible merge/fill, do real swap
uint8 msg;
uint8 msg = EQUIP_ERR_OK;
// check src->dest move possibility
ItemPosCountVec sDest;
@@ -20707,11 +20709,8 @@ void Player::resetSpells(bool myClassOnly)
if (!clsEntry)
return;
family = clsEntry->spellfamily;
}
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
{
if (myClassOnly)
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(iter->first);
if (!spellInfo)
@@ -20738,8 +20737,10 @@ void Player::resetSpells(bool myClassOnly)
if (!SpellMgr::IsSpellValid(spellInfo,this,false))
continue;
}
removeSpell(iter->first,false,false); // only iter->first can be accessed, object by iter->second can be deleted already
}
else
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
removeSpell(iter->first,false,false); // only iter->first can be accessed, object by iter->second can be deleted already
learnDefaultSpells();
learnQuestRewardedSpells();
+4 -2
View File
@@ -709,12 +709,14 @@ void LoadOverridenSQLData()
GameObjectInfo *goInfo;
// Sunwell Plateau : Kalecgos : Spectral Rift
if (goInfo = GOBJECT(187055))
goInfo = GOBJECT(187055);
if (goInfo)
if (goInfo->type == GAMEOBJECT_TYPE_GOOBER)
goInfo->goober.lockId = 57; // need LOCKTYPE_QUICK_OPEN
// Naxxramas : Sapphiron Birth
if (goInfo = GOBJECT(181356))
goInfo = GOBJECT(181356);
if (goInfo)
if (goInfo->type == GAMEOBJECT_TYPE_TRAP)
goInfo->trap.radius = 50;
}
+7 -4
View File
@@ -1335,7 +1335,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
}
// Get Data Needed for Diminishing Returns, some effects may have multiple auras, so this must be done on spell hit, not aura add
if (m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo,m_triggeredByAuraSpell))
m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo,m_triggeredByAuraSpell);
if (m_diminishGroup)
{
m_diminishLevel = unit->GetDiminishing(m_diminishGroup);
DiminishingReturnsType type = GetDiminishingReturnsGroupType(m_diminishGroup);
@@ -1372,8 +1373,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
if (m_originalCaster)
{
if (m_spellAura = Aura::TryCreate(aurSpellInfo, effectMask, unit,
m_originalCaster,(aurSpellInfo == m_spellInfo)? &m_currentBasePoints[0] : &basePoints[0], m_CastItem))
m_spellAura = Aura::TryCreate(aurSpellInfo, effectMask, unit,
m_originalCaster,(aurSpellInfo == m_spellInfo)? &m_currentBasePoints[0] : &basePoints[0], m_CastItem);
if (m_spellAura)
{
// Now Reduce spell duration using data received at spell hit
int32 duration = m_spellAura->GetMaxDuration();
@@ -4584,7 +4586,8 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_targets.getTargetMask() == TARGET_FLAG_SELF &&
m_spellInfo->EffectImplicitTargetA[1] == TARGET_UNIT_TARGET_ENEMY)
{
if (target = m_caster->GetUnit(*m_caster, m_caster->ToPlayer()->GetSelection()))
target = m_caster->GetUnit(*m_caster, m_caster->ToPlayer()->GetSelection());
if (target)
m_targets.setUnitTarget(target);
else
return SPELL_FAILED_BAD_TARGETS;
+8 -5
View File
@@ -504,15 +504,18 @@ int32 AuraEffect::CalculateAmount(Unit * caster)
AuraEffect const* pAurEff;
// Borrowed Time
if (pAurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_PRIEST, 2899, 1))
pAurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_PRIEST, 2899, 1);
if (pAurEff)
bonus += (float)pAurEff->GetAmount() / 100.0f;
// Twin Disciplines
if (pAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_PRIEST, 0x400000, 0, 0, caster->GetGUID()))
pAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_PRIEST, 0x400000, 0, 0, caster->GetGUID());
if (pAurEff)
bonus += (float)pAurEff->GetAmount() / 100.0f;
// Focused Power
if (pAurEff = caster->GetAuraEffect(SPELL_AURA_MOD_HEALING_DONE_PERCENT, SPELLFAMILY_PRIEST, 2210, 2))
pAurEff = caster->GetAuraEffect(SPELL_AURA_MOD_HEALING_DONE_PERCENT, SPELLFAMILY_PRIEST, 2210, 2);
if (pAurEff)
bonus += (float)pAurEff->GetAmount() / 100.0f;
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(GetSpellProto())) * bonus;
@@ -2053,7 +2056,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
if (target->GetPower(POWER_MANA) >= 10)
{
target->ModifyPower(POWER_MANA, -10);
target->SendEnergizeSpellLog(caster, 27746, -10, POWER_MANA);
target->SendEnergizeSpellLog(caster, 27746, 10, POWER_MANA);
}
else
target->RemoveAurasDueToSpell(27746);
@@ -3039,7 +3042,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
}
else
{
uint32 model_id;
uint32 model_id = 0;
if (uint32 modelid = ci->GetRandomValidModelId())
model_id = modelid; // Will use the default model here
+6 -3
View File
@@ -557,9 +557,12 @@ void Aura::UpdateOwner(uint32 diff, WorldObject * owner)
Spell * modSpell = NULL;
Player * modOwner = NULL;
if (caster)
if ((modOwner = caster->GetSpellModOwner())
&& (modSpell = modOwner->FindCurrentSpellBySpellId(GetId())))
modOwner->SetSpellModTakingSpell(modSpell, true);
{
modOwner = caster->GetSpellModOwner();
modSpell = modOwner->FindCurrentSpellBySpellId(GetId());
if (modOwner && modSpell)
modOwner->SetSpellModTakingSpell(modSpell, true);
}
Update(diff, caster);
+4 -2
View File
@@ -937,13 +937,15 @@ bool Guardian::UpdateStats(Stats stat)
// Ravenous Dead
AuraEffect const *aurEff;
// Check just if owner has Ravenous Dead since it's effect is not an aura
if (aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0))
aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
if (aurEff)
{
SpellEntry const* sProto = aurEff->GetSpellProto(); // Then get the SpellProto and add the dummy effect value
mod += mod * (sProto->EffectBasePoints[1] / 100.0f); // Ravenous Dead edits the original scale
}
// Glyph of the Ghoul
if (aurEff = owner->GetAuraEffect(58686, 0))
aurEff = owner->GetAuraEffect(58686, 0);
if (aurEff)
mod += (aurEff->GetAmount() / 100.0f); // Glyph of the Ghoul adds a flat value to the scale mod
value += float(owner->GetStat(stat)) * mod;
}
+1 -7
View File
@@ -249,16 +249,10 @@ void TempSummon::RemoveFromWorld()
return;
if (m_Properties)
{
if (uint32 slot = m_Properties->Slot)
{
if (Unit* owner = GetSummoner())
{
if (owner->m_SummonSlot[slot] = GetGUID())
if (owner->m_SummonSlot[slot] == GetGUID())
owner->m_SummonSlot[slot] = 0;
}
}
}
//if (GetOwnerGUID())
// sLog.outError("Unit %u has owner guid when removed from world", GetEntry());
+13 -10
View File
@@ -3631,8 +3631,8 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
}
bool auraStateFound = false;
AuraState auraState;
if (auraState = GetSpellAuraState(aura->GetSpellProto()))
AuraState auraState = GetSpellAuraState(aura->GetSpellProto());
if (auraState)
{
bool canBreak = false;
// Get mask of all aurastates from remaining auras
@@ -5950,7 +5950,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if ((*i)->GetEffIndex() != 0)
continue;
basepoints0 = int32((*i)->GetAmount());
if (target = GetGuardianPet())
target = GetGuardianPet();
if (target)
{
// regen mana for pet
CastCustomSpell(target,54607,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
@@ -12111,10 +12112,10 @@ Unit* Creature::SelectVictim()
const AuraEffectList& tauntAuras = GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
if (!tauntAuras.empty())
{
Unit* caster;
Unit* caster = tauntAuras.back()->GetCaster();
// The last taunt aura caster is alive an we are happy to attack him
if ((caster = tauntAuras.back()->GetCaster()) && caster->isAlive())
if (caster && caster->isAlive())
return getVictim();
else if (tauntAuras.size() > 1)
{
@@ -12126,8 +12127,8 @@ Unit* Creature::SelectVictim()
do
{
--aura;
if ((caster = (*aura)->GetCaster()) &&
caster->IsInMap(this) && canAttack(caster) && caster->isInAccessiblePlaceFor(this->ToCreature()))
caster = (*aura)->GetCaster();
if (caster && caster->IsInMap(this) && canAttack(caster) && caster->isInAccessiblePlaceFor(this->ToCreature()))
{
target = caster;
break;
@@ -12194,9 +12195,11 @@ Unit* Creature::SelectVictim()
// search nearby enemy before enter evade mode
if (HasReactState(REACT_AGGRESSIVE))
if (target = SelectNearestTarget())
if (_IsTargetAcceptable(target))
{
target = SelectNearestTarget();
if (target && _IsTargetAcceptable(target))
return target;
}
if (m_invisibilityMask)
{
@@ -13221,7 +13224,7 @@ void CharmInfo::InitCharmCreateSpells()
{
m_charmspells[x].SetActionAndType(spellId,ACT_DISABLED);
ActiveStates newstate;
ActiveStates newstate = ACT_PASSIVE;
if (spellInfo)
{
if (!IsAutocastableSpell(spellId))
+1 -1
View File
@@ -68,7 +68,7 @@ bool WaypointMovementGenerator<Player>::GetDestination(float & /*x*/, float & /*
}
template<>
void WaypointMovementGenerator<Creature>::Reset(Creature & /*unit*/unit)
void WaypointMovementGenerator<Creature>::Reset(Creature & /*unit*/)
{
StopedByPlayer = true;
i_nextMoveTime.Reset(0);