[8475] fixed some gcc-warnings

all warnings from Wunused
and some from Wall

cause unused may be most interesting for some:
they were in following files:
src/game/Level2.cpp
src/game/Map.cpp
src/game/SpellAuras.cpp
src/game/Unit.cpp
src/mangosd/Master.cpp
but i guess mostly someone just fogot to remove this code

for some unsigned vs signed warnings i used:
ack "for.*int .*size\(\)" | ack -v uint

also note for coding:
if you do something like
    if( a && b || c)
just place parentheses around (a && b) && always will have
precedence over || but without parentheses this could be overseen
quite fast (at least that's my guess why gcc will warn for this)

Signed-off-by: balrok <der-coole-carl@gmx.net>
This commit is contained in:
balrok 2009-09-05 10:42:36 +02:00
parent 56ddf40d62
commit bd30769dec
36 changed files with 96 additions and 101 deletions

View file

@ -1788,5 +1788,6 @@ WorldSafeLocsEntry const* BattleGround::GetClosestGraveYard( Player* player )
bool BattleGround::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const bool BattleGround::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const
{ {
BattleGroundTeamId team_idx = GetTeamIndexByTeamId(team); BattleGroundTeamId team_idx = GetTeamIndexByTeamId(team);
return m_TeamScores[team_idx] >= minScore && m_TeamScores[team_idx] <= maxScore; uint32 score = (m_TeamScores[team_idx] < 0) ? 0 : uint32(m_TeamScores[team_idx]);
return score >= minScore && score <= maxScore;
} }

View file

@ -676,8 +676,8 @@ bool BattleGroundAB::IsAllNodesConrolledByTeam(uint32 team) const
{ {
uint32 count = 0; uint32 count = 0;
for(int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) for(int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
if (team == ALLIANCE && m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED || if ((team == ALLIANCE && m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED) ||
team == HORDE && m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED) (team == HORDE && m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED))
++count; ++count;
return count == BG_AB_DYNAMIC_NODES_COUNT; return count == BG_AB_DYNAMIC_NODES_COUNT;

View file

@ -146,8 +146,8 @@ class BGQueueInviteEvent : public BasicEvent
private: private:
uint64 m_PlayerGuid; uint64 m_PlayerGuid;
uint32 m_BgInstanceGUID; uint32 m_BgInstanceGUID;
uint32 m_RemoveTime;
BattleGroundTypeId m_BgTypeId; BattleGroundTypeId m_BgTypeId;
uint32 m_RemoveTime;
}; };
/* /*

View file

@ -1293,7 +1293,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data)
uint8 srcbag, srcslot; uint8 srcbag, srcslot;
recv_data >> srcbag >> srcslot; recv_data >> srcbag >> srcslot;
sLog.outDebug("Item " I64FMT ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); sLog.outDebug("Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot);
Item *item = _player->GetItemByGuid(itemGuid); Item *item = _player->GetItemByGuid(itemGuid);

View file

@ -1177,7 +1177,7 @@ valid examples:
char c = reader.peek(); char c = reader.peek();
// ignore enchants etc. // ignore enchants etc.
while(c >='0' && c <='9' || c==':') while ((c >= '0' && c <= '9') || c== ':')
{ {
reader.ignore(1); reader.ignore(1);
c = reader.peek(); c = reader.peek();
@ -2201,4 +2201,4 @@ LocaleConstant CliHandler::GetSessionDbcLocale() const
int CliHandler::GetSessionDbLocaleIndex() const int CliHandler::GetSessionDbLocaleIndex() const
{ {
return objmgr.GetDBCLocaleIndex(); return objmgr.GetDBCLocaleIndex();
} }

View file

@ -153,7 +153,7 @@ void Creature::RemoveFromWorld()
void Creature::RemoveCorpse() void Creature::RemoveCorpse()
{ {
if( getDeathState()!=CORPSE && !m_isDeadByDefault || getDeathState()!=ALIVE && m_isDeadByDefault ) if ((getDeathState() != CORPSE && !m_isDeadByDefault) || (getDeathState() != ALIVE && m_isDeadByDefault))
return; return;
m_deathTimer = 0; m_deathTimer = 0;
@ -1459,8 +1459,8 @@ float Creature::GetAttackDistance(Unit const* pl) const
if(aggroRate==0) if(aggroRate==0)
return 0.0f; return 0.0f;
int32 playerlevel = pl->getLevelForTarget(this); uint32 playerlevel = pl->getLevelForTarget(this);
int32 creaturelevel = getLevelForTarget(pl); uint32 creaturelevel = getLevelForTarget(pl);
int32 leveldif = playerlevel - creaturelevel; int32 leveldif = playerlevel - creaturelevel;
@ -1730,7 +1730,7 @@ bool Creature::IsVisibleInGridForPlayer(Player* pl) const
{ {
if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INVISIBLE) if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INVISIBLE)
return false; return false;
return isAlive() || m_deathTimer > 0 || m_isDeadByDefault && m_deathState==CORPSE; return (isAlive() || m_deathTimer > 0 || (m_isDeadByDefault && m_deathState == CORPSE));
} }
// Dead player see live creatures near own corpse // Dead player see live creatures near own corpse

View file

@ -378,7 +378,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
target = owner; target = owner;
} }
} }
else if (target = m_creature->getVictim()) else if ((target = m_creature->getVictim()))
{ {
if (target->GetTypeId() != TYPEID_PLAYER) if (target->GetTypeId() != TYPEID_PLAYER)
if (Unit* owner = target->GetOwner()) if (Unit* owner = target->GetOwner())

View file

@ -386,6 +386,7 @@ void GameObject::Update(uint32 /*p_time*/)
if (GetGOInfo()->GetAutoCloseTime() && (m_cooldownTime < time(NULL))) if (GetGOInfo()->GetAutoCloseTime() && (m_cooldownTime < time(NULL)))
ResetDoorOrButton(); ResetDoorOrButton();
break; break;
default: break;
} }
break; break;
} }

View file

@ -872,11 +872,11 @@ namespace MaNGOS
return false; return false;
} }
private: private:
bool i_hitHidden;
bool i_targetForPlayer; bool i_targetForPlayer;
WorldObject const* i_obj; WorldObject const* i_obj;
Unit const* i_funit; Unit const* i_funit;
float i_range; float i_range;
bool i_hitHidden;
}; };
// do attack at call of help to friendly crearture // do attack at call of help to friendly crearture
@ -1076,7 +1076,7 @@ namespace MaNGOS
~LocalizedPacketListDo() ~LocalizedPacketListDo()
{ {
for(size_t i = 0; i < i_data_cache.size(); ++i) for(size_t i = 0; i < i_data_cache.size(); ++i)
for(int j = 0; j < i_data_cache[i].size(); ++j) for(size_t j = 0; j < i_data_cache[i].size(); ++j)
delete i_data_cache[i][j]; delete i_data_cache[i][j];
} }
void operator()( Player* p ); void operator()( Player* p );

View file

@ -1076,7 +1076,7 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data )
recv_data >> unk2; // always 0 recv_data >> unk2; // always 0
recv_data >> SplitedAmount; recv_data >> SplitedAmount;
if (BankTabSlotDst >= GUILD_BANK_MAX_SLOTS || BankTabDst == BankTab && BankTabSlotDst == BankTabSlot) if (BankTabSlotDst >= GUILD_BANK_MAX_SLOTS || (BankTabDst == BankTab && BankTabSlotDst == BankTabSlot))
{ {
recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet
return; return;

View file

@ -143,7 +143,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
// save or plan save after 20 sec (logout delay) if current next save time more this value and _not_ output any messages to prevent cheat planning // save or plan save after 20 sec (logout delay) if current next save time more this value and _not_ output any messages to prevent cheat planning
uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE); uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
if(save_interval==0 || save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS) if (save_interval==0 || (save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS))
player->SaveToDB(); player->SaveToDB();
return true; return true;
@ -158,7 +158,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
for(; itr != m.end(); ++itr) for(; itr != m.end(); ++itr)
{ {
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity(); AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
if ((itr->second->isGameMaster() || itr_sec > SEC_PLAYER && itr_sec <= sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST)) && if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST))) &&
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer()))) (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
{ {
if(first) if(first)

View file

@ -658,7 +658,7 @@ bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
uint64 titles2 = titles; uint64 titles2 = titles;
for(int i = 1; i < sCharTitlesStore.GetNumRows(); ++i) for(uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i)
if(CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i)) if(CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i))
titles2 &= ~(uint64(1) << tEntry->bit_index); titles2 &= ~(uint64(1) << tEntry->bit_index);
@ -2275,7 +2275,7 @@ bool ChatHandler::HandleGoTaxinodeCommand(const char* args)
return false; return false;
} }
if (node->x == 0.0f && node->y == 0.0f && node->z == 0.0f || if ((node->x == 0.0f && node->y == 0.0f && node->z == 0.0f) ||
!MapManager::IsValidMapCoord(node->map_id,node->x,node->y,node->z)) !MapManager::IsValidMapCoord(node->map_id,node->x,node->y,node->z))
{ {
PSendSysMessage(LANG_INVALID_TARGET_COORD,node->x,node->y,node->map_id); PSendSysMessage(LANG_INVALID_TARGET_COORD,node->x,node->y,node->map_id);
@ -2412,7 +2412,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
float y = (float)atof(py); float y = (float)atof(py);
// prevent accept wrong numeric args // prevent accept wrong numeric args
if (x==0.0f && *px!='0' || y==0.0f && *py!='0') if ((x==0.0f && *px!='0') || (y==0.0f && *py!='0'))
return false; return false;
uint32 areaid = cAreaId ? (uint32)atoi(cAreaId) : _player->GetZoneId(); uint32 areaid = cAreaId ? (uint32)atoi(cAreaId) : _player->GetZoneId();

View file

@ -3180,7 +3180,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
} }
wpCreature->SetVisibility(VISIBILITY_OFF); wpCreature->SetVisibility(VISIBILITY_OFF);
sLog.outDebug("DEBUG: UPDATE creature_movement SET wpguid = '%u"); sLog.outDebug("DEBUG: UPDATE creature_movement SET wpguid = '%u", wpCreature->GetGUIDLow());
// set "wpguid" column to the visual waypoint // set "wpguid" column to the visual waypoint
WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), lowguid, point); WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), lowguid, point);
@ -3928,8 +3928,6 @@ void ChatHandler::HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id)
bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/) bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/)
{ {
uint32 classmask = m_session->GetPlayer()->getClassMask();
for (uint32 i = 0; i < sSkillLineStore.GetNumRows(); ++i) for (uint32 i = 0; i < sSkillLineStore.GetNumRows(); ++i)
{ {
SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(i); SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(i);
@ -3970,8 +3968,6 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
// converting string that we try to find to lower case // converting string that we try to find to lower case
wstrToLower( wnamepart ); wstrToLower( wnamepart );
uint32 classmask = m_session->GetPlayer()->getClassMask();
std::string name; std::string name;
SkillLineEntry const *targetSkillInfo = NULL; SkillLineEntry const *targetSkillInfo = NULL;

View file

@ -4581,7 +4581,7 @@ bool ChatHandler::HandleServerRestartCommand(const char* args)
int32 time = atoi (time_str); int32 time = atoi (time_str);
///- Prevent interpret wrong arg value as 0 secs shutdown time ///- Prevent interpret wrong arg value as 0 secs shutdown time
if(time == 0 && (time_str[0]!='0' || time_str[1]!='\0') || time < 0) if ((time == 0 && (time_str[0]!='0' || time_str[1]!='\0')) || time < 0)
return false; return false;
if (exitcode_str) if (exitcode_str)
@ -4616,7 +4616,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char* args)
int32 time = atoi (time_str); int32 time = atoi (time_str);
///- Prevent interpret wrong arg value as 0 secs shutdown time ///- Prevent interpret wrong arg value as 0 secs shutdown time
if(time == 0 && (time_str[0]!='0' || time_str[1]!='\0') || time < 0) if ((time == 0 && (time_str[0]!='0' || time_str[1]!='\0')) || time < 0)
return false; return false;
if (exitcode_str) if (exitcode_str)
@ -4651,7 +4651,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char* args)
int32 time = atoi (time_str); int32 time = atoi (time_str);
///- Prevent interpret wrong arg value as 0 secs shutdown time ///- Prevent interpret wrong arg value as 0 secs shutdown time
if(time == 0 && (time_str[0]!='0' || time_str[1]!='\0') || time < 0) if ((time == 0 && (time_str[0]!='0' || time_str[1]!='\0')) || time < 0)
return false; return false;
if (exitcode_str) if (exitcode_str)
@ -6182,7 +6182,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
} }
uint32 item_count = itemCountStr ? atoi(itemCountStr) : 1; uint32 item_count = itemCountStr ? atoi(itemCountStr) : 1;
if(item_count < 1 || item_proto->MaxCount > 0 && item_count > uint32(item_proto->MaxCount)) if (item_count < 1 || (item_proto->MaxCount > 0 && item_count > uint32(item_proto->MaxCount)))
{ {
PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count,item_id); PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count,item_id);
SetSentErrorMessage(true); SetSentErrorMessage(true);

View file

@ -45,7 +45,7 @@ void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
GameObject *go = player->GetMap()->GetGameObject(lguid); GameObject *go = player->GetMap()->GetGameObject(lguid);
// not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO // not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO
if (!go || (go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player,INTERACTION_DISTANCE)))
{ {
player->SendLootRelease(lguid); player->SendLootRelease(lguid);
return; return;
@ -280,7 +280,7 @@ void WorldSession::DoLootRelease( uint64 lguid )
GameObject *go = GetPlayer()->GetMap()->GetGameObject(lguid); GameObject *go = GetPlayer()->GetMap()->GetGameObject(lguid);
// not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO // not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO
if (!go || (go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player,INTERACTION_DISTANCE)))
return; return;
loot = &go->loot; loot = &go->loot;

View file

@ -1789,7 +1789,8 @@ uint16 Map::GetAreaFlag(float x, float y, float z) const
// Makers' Overlook (ground and cave) // Makers' Overlook (ground and cave)
else if (x > 5634.48f && x < 5774.53f && y < 3475.0f && z > 300.0f) else if (x > 5634.48f && x < 5774.53f && y < 3475.0f && z > 300.0f)
{ {
if(y > 3380.26f || y > 3265.0f && z < 360.0f) areaflag = 2187; if (y > 3380.26f || (y > 3265.0f && z < 360.0f))
areaflag = 2187;
} }
break; break;
// The Makers' Perch (underground) // The Makers' Perch (underground)
@ -1868,7 +1869,7 @@ void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 area
bool Map::IsInWater(float x, float y, float pZ) const bool Map::IsInWater(float x, float y, float pZ) const
{ {
// Check surface in x, y point for liquid // Check surface in x, y point for liquid
if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y)) if (const_cast<Map*>(this)->GetGrid(x, y))
{ {
LiquidData liquid_status; LiquidData liquid_status;
if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, &liquid_status)) if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, &liquid_status))
@ -1882,7 +1883,7 @@ bool Map::IsInWater(float x, float y, float pZ) const
bool Map::IsUnderWater(float x, float y, float z) const bool Map::IsUnderWater(float x, float y, float z) const
{ {
if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y)) if (const_cast<Map*>(this)->GetGrid(x, y))
{ {
if (getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN)&LIQUID_MAP_UNDER_WATER) if (getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN)&LIQUID_MAP_UNDER_WATER)
return true; return true;

View file

@ -478,6 +478,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
ActiveNonPlayers m_activeNonPlayers; ActiveNonPlayers m_activeNonPlayers;
ActiveNonPlayers::iterator m_activeNonPlayersIter; ActiveNonPlayers::iterator m_activeNonPlayersIter;
private: private:
time_t i_gridExpiry;
//used for fast base_map (e.g. MapInstanced class object) search for //used for fast base_map (e.g. MapInstanced class object) search for
//InstanceMaps and BattleGroundMaps... //InstanceMaps and BattleGroundMaps...
Map* m_parentMap; Map* m_parentMap;
@ -489,8 +491,6 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
GridMap *GridMaps[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; GridMap *GridMaps[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS];
std::bitset<TOTAL_NUMBER_OF_CELLS_PER_MAP*TOTAL_NUMBER_OF_CELLS_PER_MAP> marked_cells; std::bitset<TOTAL_NUMBER_OF_CELLS_PER_MAP*TOTAL_NUMBER_OF_CELLS_PER_MAP> marked_cells;
time_t i_gridExpiry;
std::set<WorldObject *> i_objectsToRemove; std::set<WorldObject *> i_objectsToRemove;
std::multimap<time_t, ScriptAction> m_scriptSchedule; std::multimap<time_t, ScriptAction> m_scriptSchedule;

View file

@ -90,7 +90,7 @@ MotionMaster::UpdateMotion(uint32 diff)
if (m_expList) if (m_expList)
{ {
for (int i = 0; i < m_expList->size(); ++i) for (size_t i = 0; i < m_expList->size(); ++i)
{ {
MovementGenerator* mg = (*m_expList)[i]; MovementGenerator* mg = (*m_expList)[i];
if (!isStatic(mg)) if (!isStatic(mg))

View file

@ -438,7 +438,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
if(_player->m_mover->GetGUID() != guid) if(_player->m_mover->GetGUID() != guid)
{ {
sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " I64FMT " and should be " I64FMT, _player->m_mover->GetGUID(), guid); sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, _player->m_mover->GetGUID(), guid);
return; return;
} }
} }
@ -453,7 +453,7 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data)
if(_player->m_mover->GetGUID() == old_mover_guid) if(_player->m_mover->GetGUID() == old_mover_guid)
{ {
sLog.outError("HandleMoveNotActiveMover: incorrect mover guid: mover is " I64FMT " and should be " I64FMT " instead of " I64FMT, _player->m_mover->GetGUID(), _player->GetGUID(), old_mover_guid); sLog.outError("HandleMoveNotActiveMover: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD " instead of " UI64FMTD, _player->m_mover->GetGUID(), _player->GetGUID(), old_mover_guid);
recv_data.rpos(recv_data.wpos()); // prevent warnings spam recv_data.rpos(recv_data.wpos()); // prevent warnings spam
return; return;
} }

View file

@ -111,7 +111,7 @@ bool SpellClickInfo::IsFitToRequirements(Player const* player) const
if(questStart) if(questStart)
{ {
// not in expected required quest state // not in expected required quest state
if(!player || (!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart)) if (!player || ((!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart)))
return false; return false;
} }
@ -782,8 +782,8 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const*
// replace by new structures array // replace by new structures array
const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()/2+1]; const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()/2+1];
int i=0; uint32 i=0;
for(int j=0;j<val.size()/2;++j) for(uint32 j = 0; j < val.size()/2; ++j)
{ {
CreatureDataAddonAura& cAura = const_cast<CreatureDataAddonAura&>(addon->auras[i]); CreatureDataAddonAura& cAura = const_cast<CreatureDataAddonAura&>(addon->auras[i]);
cAura.spell_id = (uint32)val[2*j+0]; cAura.spell_id = (uint32)val[2*j+0];
@ -1082,7 +1082,7 @@ void ObjectMgr::LoadCreatures()
if(heroicCreatures.find(data.id)!=heroicCreatures.end()) if(heroicCreatures.find(data.id)!=heroicCreatures.end())
{ {
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as heroic template in `creature_template`, skipped.",guid,data.id ); sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as heroic template (entry: %u) in `creature_template`, skipped.",guid, data.id );
continue; continue;
} }
@ -3464,8 +3464,8 @@ void ObjectMgr::LoadQuests()
bool found = false; bool found = false;
for(int k = 0; k < 3; ++k) for(int k = 0; k < 3; ++k)
{ {
if( spellInfo->Effect[k]==SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->EffectMiscValue[k])==qinfo->QuestId || if ((spellInfo->Effect[k] == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->EffectMiscValue[k]) == qinfo->QuestId) ||
spellInfo->Effect[k]==SPELL_EFFECT_SEND_EVENT) spellInfo->Effect[k] == SPELL_EFFECT_SEND_EVENT)
{ {
found = true; found = true;
break; break;
@ -7080,7 +7080,10 @@ bool PlayerCondition::Meets(Player const * player) const
case CONDITION_REPUTATION_RANK: case CONDITION_REPUTATION_RANK:
{ {
FactionEntry const* faction = sFactionStore.LookupEntry(value1); FactionEntry const* faction = sFactionStore.LookupEntry(value1);
return faction && player->GetReputationMgr().GetRank(faction) >= value2; // -1 used if faction couldn't be found
if (player->GetReputationMgr().GetRank(faction) == -1)
return false;
return faction && uint32(player->GetReputationMgr().GetRank(faction)) >= value2;
} }
case CONDITION_TEAM: case CONDITION_TEAM:
return player->GetTeam() == value1; return player->GetTeam() == value1;

View file

@ -776,9 +776,9 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
void Player::SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, int32 Regen) void Player::SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, int32 Regen)
{ {
if (MaxValue == DISABLED_MIRROR_TIMER) if (int(MaxValue) == DISABLED_MIRROR_TIMER)
{ {
if (CurrentValue!=DISABLED_MIRROR_TIMER) if (int(CurrentValue) != DISABLED_MIRROR_TIMER)
StopMirrorTimer(Type); StopMirrorTimer(Type);
return; return;
} }
@ -1499,7 +1499,7 @@ bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
if(!enchantId) if(!enchantId)
continue; continue;
if(enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)) if ((enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)))
break; break;
} }
@ -2260,9 +2260,8 @@ bool Player::IsGroupVisibleFor(Player* p) const
bool Player::IsInSameGroupWith(Player const* p) const bool Player::IsInSameGroupWith(Player const* p) const
{ {
return p==this || GetGroup() != NULL && return (p==this || (GetGroup() != NULL &&
GetGroup() == p->GetGroup() && GetGroup()->SameSubGroup((Player*)this, (Player*)p)));
GetGroup()->SameSubGroup((Player*)this, (Player*)p);
} }
///- If the player is invited, remove him. If the group if then only 1 person, disband the group. ///- If the player is invited, remove him. If the group if then only 1 person, disband the group.
@ -3064,7 +3063,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
if (_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL || if (_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ||
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL // lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
(pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0 ) ((pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0))
{ {
switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask!=0)) switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask!=0))
{ {
@ -3118,7 +3117,7 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const
{ {
// note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell // note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell
// talent dependent passives activated at form apply have proper stance data // talent dependent passives activated at form apply have proper stance data
bool need_cast = !spellInfo->Stances || m_form != 0 && (spellInfo->Stances & (1<<(m_form-1))); bool need_cast = (!spellInfo->Stances || (m_form != 0 && (spellInfo->Stances & (1<<(m_form-1)))));
//Check CasterAuraStates //Check CasterAuraStates
return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState))); return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState)));
@ -3160,7 +3159,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
if (itr == m_spells.end()) if (itr == m_spells.end())
return; return;
if(itr->second->state == PLAYERSPELL_REMOVED || disabled && itr->second->disabled) if (itr->second->state == PLAYERSPELL_REMOVED || (disabled && itr->second->disabled))
return; return;
// unlearn non talent higher ranks (recursive) // unlearn non talent higher ranks (recursive)
@ -3270,7 +3269,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL && if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL &&
pSkill->categoryId != SKILL_CATEGORY_CLASS ||// not unlearn class skills (spellbook/talent pages) pSkill->categoryId != SKILL_CATEGORY_CLASS ||// not unlearn class skills (spellbook/talent pages)
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL // lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
(pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0 ) ((pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0))
{ {
// not reset skills for professions and racial abilities // not reset skills for professions and racial abilities
if ((pSkill->categoryId==SKILL_CATEGORY_SECONDARY || pSkill->categoryId==SKILL_CATEGORY_PROFESSION) && if ((pSkill->categoryId==SKILL_CATEGORY_SECONDARY || pSkill->categoryId==SKILL_CATEGORY_PROFESSION) &&
@ -4495,7 +4494,7 @@ void Player::RepopAtGraveyard()
AreaTableEntry const *zone = GetAreaEntryByAreaID(GetAreaId()); AreaTableEntry const *zone = GetAreaEntryByAreaID(GetAreaId());
// Such zones are considered unreachable as a ghost and the player must be automatically revived // Such zones are considered unreachable as a ghost and the player must be automatically revived
if(!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY || GetTransport()) if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport())
{ {
ResurrectPlayer(0.5f); ResurrectPlayer(0.5f);
SpawnCorpseBones(); SpawnCorpseBones();
@ -6736,7 +6735,7 @@ 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 set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage
if (ssv) if (ssv)
{ {
if (extraDPS = ssv->getDPSMod(proto->ScalingStatValue)) if ((extraDPS = ssv->getDPSMod(proto->ScalingStatValue)))
{ {
float average = extraDPS * proto->Delay / 1000.0f; float average = extraDPS * proto->Delay / 1000.0f;
minDamage = 0.7f * average; minDamage = 0.7f * average;
@ -8459,10 +8458,10 @@ Item* Player::GetItemByPos( uint16 pos ) const
Item* Player::GetItemByPos( uint8 bag, uint8 slot ) const Item* Player::GetItemByPos( uint8 bag, uint8 slot ) const
{ {
if( bag == INVENTORY_SLOT_BAG_0 && ( slot < BANK_SLOT_BAG_END || slot >= KEYRING_SLOT_START && slot < CURRENCYTOKEN_SLOT_END ) ) if( bag == INVENTORY_SLOT_BAG_0 && ( slot < BANK_SLOT_BAG_END || (slot >= KEYRING_SLOT_START && slot < CURRENCYTOKEN_SLOT_END )) )
return m_items[slot]; return m_items[slot];
else if(bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END else if ((bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)
|| bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END ) || (bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END) )
{ {
Bag *pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, bag ); Bag *pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, bag );
if ( pBag ) if ( pBag )
@ -11095,7 +11094,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
if(IsEquipmentPos ( src ) || IsBagPos ( src )) if(IsEquipmentPos ( src ) || IsBagPos ( src ))
{ {
// bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later) // bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later)
uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ) || pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty()); uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ) || (pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty()));
if(msg != EQUIP_ERR_OK) if(msg != EQUIP_ERR_OK)
{ {
SendEquipError( msg, pSrcItem, pDstItem ); SendEquipError( msg, pSrcItem, pDstItem );
@ -11125,7 +11124,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
if(IsEquipmentPos ( dst ) || IsBagPos ( dst )) if(IsEquipmentPos ( dst ) || IsBagPos ( dst ))
{ {
// bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later) // bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later)
uint8 msg = CanUnequipItem( dst, !IsBagPos ( dst ) || IsBagPos ( src ) || pSrcItem->IsBag() && ((Bag*)pSrcItem)->IsEmpty()); uint8 msg = CanUnequipItem( dst, !IsBagPos ( dst ) || IsBagPos ( src ) || (pSrcItem->IsBag() && ((Bag*)pSrcItem)->IsEmpty()));
if(msg != EQUIP_ERR_OK) if(msg != EQUIP_ERR_OK)
{ {
SendEquipError( msg, pSrcItem, pDstItem ); SendEquipError( msg, pSrcItem, pDstItem );
@ -11543,7 +11542,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
Item* item = *itr; Item* item = *itr;
++itr; // current element can be erased in UpdateDuration ++itr; // current element can be erased in UpdateDuration
if (realtimeonly && item->GetProto()->Duration < 0 || !realtimeonly) if ((realtimeonly && item->GetProto()->Duration < 0) || !realtimeonly)
item->UpdateDuration(this,time); item->UpdateDuration(this,time);
} }
} }
@ -14066,7 +14065,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// check name limitations // check name limitations
if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS || if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS ||
GetSession()->GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(m_name)) (GetSession()->GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(m_name)))
{ {
delete result; delete result;
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid); CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid);
@ -15718,8 +15717,6 @@ void Player::_SaveAuras()
// save previous spellEffectPair to db // save previous spellEffectPair to db
itr2--; itr2--;
SpellEntry const *spellInfo = itr2->second->GetSpellProto();
//skip all auras from spells that are passive //skip all auras from spells that are passive
//do not save single target auras (unless they were cast by the player) //do not save single target auras (unless they were cast by the player)
if (!itr2->second->IsPassive() && (itr2->second->GetCasterGUID() == GetGUID() || !itr2->second->IsSingleTarget())) if (!itr2->second->IsPassive() && (itr2->second->GetCasterGUID() == GetGUID() || !itr2->second->IsSingleTarget()))
@ -16989,7 +16986,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
uint32 mount_display_id = objmgr.GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == NULL); uint32 mount_display_id = objmgr.GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == NULL);
// in spell case allow 0 model // in spell case allow 0 model
if (mount_display_id == 0 && spellid == 0 || sourcepath == 0) if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0)
{ {
WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR); data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR);
@ -19151,8 +19148,8 @@ void Player::UpdateAreaDependentAuras( uint32 newArea )
uint32 Player::GetCorpseReclaimDelay(bool pvp) const uint32 Player::GetCorpseReclaimDelay(bool pvp) const
{ {
if( pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP) || if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ) (!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
{ {
return copseReclaimDelay[0]; return copseReclaimDelay[0];
} }
@ -19167,8 +19164,8 @@ void Player::UpdateCorpseReclaimDelay()
{ {
bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH; bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH;
if( pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP) || if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ) (!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
return; return;
time_t now = time(NULL); time_t now = time(NULL);

View file

@ -100,7 +100,7 @@ uint32 PoolGroup<T>::RollOne(void)
template<class T> template<class T>
void PoolGroup<T>::DespawnObject(uint32 guid) void PoolGroup<T>::DespawnObject(uint32 guid)
{ {
for (int i=0; i<EqualChanced.size(); ++i) for (size_t i=0; i < EqualChanced.size(); ++i)
{ {
if (EqualChanced[i].spawned) if (EqualChanced[i].spawned)
{ {
@ -189,7 +189,7 @@ void PoolGroup<T>::SpawnObject(uint32 limit, bool cache)
else if (limit < EqualChanced.size() && Spawned < limit) else if (limit < EqualChanced.size() && Spawned < limit)
{ {
std::vector<uint32> IndexList; std::vector<uint32> IndexList;
for (int i=0; i<EqualChanced.size(); ++i) for (size_t i = 0; i < EqualChanced.size(); ++i)
if (!EqualChanced[i].spawned) if (!EqualChanced[i].spawned)
IndexList.push_back(i); IndexList.push_back(i);
@ -215,7 +215,7 @@ void PoolGroup<T>::SpawnObject(uint32 limit, bool cache)
} }
else // Not enough objects in pool, so spawn all else // Not enough objects in pool, so spawn all
{ {
for (int i=0; i<EqualChanced.size(); ++i) for (size_t i = 0; i < EqualChanced.size(); ++i)
EqualChanced[i].spawned = Spawn1Object(EqualChanced[i].guid); EqualChanced[i].spawned = Spawn1Object(EqualChanced[i].guid);
} }
} }

View file

@ -199,7 +199,7 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all // MODERATOR, GAME MASTER, ADMINISTRATOR can see all
if (pFriend && pFriend->GetName() && if (pFriend && pFriend->GetName() &&
(security > SEC_PLAYER || (security > SEC_PLAYER ||
(pFriend->GetTeam() == team || allowTwoSideWhoList) && (pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList)) && ((pFriend->GetTeam() == team || allowTwoSideWhoList) && (pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList))) &&
pFriend->IsVisibleGloballyFor(player)) pFriend->IsVisibleGloballyFor(player))
{ {
friendInfo.Status = FRIEND_STATUS_ONLINE; friendInfo.Status = FRIEND_STATUS_ONLINE;
@ -285,7 +285,7 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all // MODERATOR, GAME MASTER, ADMINISTRATOR can see all
if (pFriend && pFriend->IsInWorld() && if (pFriend && pFriend->IsInWorld() &&
(pFriend->GetSession()->GetSecurity() > SEC_PLAYER || (pFriend->GetSession()->GetSecurity() > SEC_PLAYER ||
(pFriend->GetTeam() == team || allowTwoSideWhoList) && security <= gmLevelInWhoList) && ((pFriend->GetTeam() == team || allowTwoSideWhoList) && security <= gmLevelInWhoList)) &&
player->IsVisibleGloballyFor(pFriend)) player->IsVisibleGloballyFor(pFriend))
{ {
pFriend->GetSession()->SendPacket(packet); pFriend->GetSession()->SendPacket(packet);

View file

@ -4866,6 +4866,7 @@ SpellCastResult Spell::CheckCasterAuras() const
else if ( m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE) else if ( m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
return SPELL_FAILED_SILENCED; return SPELL_FAILED_SILENCED;
break; break;
default: break;
} }
} }
} }
@ -5987,4 +5988,4 @@ void Spell::FillRaidOrPartyHealthPriorityTargets( UnitList &TagUnitMap, Unit* me
TagUnitMap.push_back(healthQueue.top().getUnit()); TagUnitMap.push_back(healthQueue.top().getUnit());
healthQueue.pop(); healthQueue.pop();
} }
} }

View file

@ -1325,8 +1325,6 @@ void Aura::HandleAddModifier(bool apply, bool Real)
m_spellmod = mod; m_spellmod = mod;
} }
uint64 spellFamilyMask = m_spellmod->mask;
((Player*)m_target)->AddSpellMod(m_spellmod, apply); ((Player*)m_target)->AddSpellMod(m_spellmod, apply);
// reapply talents to own passive persistent auras // reapply talents to own passive persistent auras

View file

@ -2989,7 +2989,8 @@ void SpellMgr::CheckUsedSpells(char const* table)
{ {
if(spellEntry->SpellFamilyFlags != 0 || spellEntry->SpellFamilyFlags2 != 0) if(spellEntry->SpellFamilyFlags != 0 || spellEntry->SpellFamilyFlags2 != 0)
{ {
sLog.outError("Spell %u '%s' not fit to (" I64FMT "," I32FMT ") but used in %s.",spell,name.c_str(),familyMaskA,familyMaskB,code.c_str()); sLog.outError("Spell %u '%s' not fit to (" UI64FMTD "," I32FMT ") but used in %s.",
spell, name.c_str(), familyMaskA, familyMaskB, code.c_str());
continue; continue;
} }

View file

@ -167,16 +167,16 @@ inline bool IsElementalShield(SpellEntry const *spellInfo)
inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo) inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo)
{ {
return spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM return ((spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM
&& spellInfo->Effect[1] == SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->Effect[1] == SPELL_EFFECT_SCRIPT_EFFECT)
|| spellInfo->Id == 64323; // Book of Glyph Mastery (Effect0==SPELL_EFFECT_SCRIPT_EFFECT without any other data) || spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0==SPELL_EFFECT_SCRIPT_EFFECT without any other data)
} }
inline bool IsLootCraftingSpell(SpellEntry const *spellInfo) inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)
{ {
return spellInfo->Effect[0]==SPELL_EFFECT_CREATE_RANDOM_ITEM || return (spellInfo->Effect[0]==SPELL_EFFECT_CREATE_RANDOM_ITEM ||
// different random cards from Inscription (121==Virtuoso Inking Set category) // different random cards from Inscription (121==Virtuoso Inking Set category)
spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121; (spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121));
} }
int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2); int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);

View file

@ -309,6 +309,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
} }
break; break;
} }
default: break;
} }
switch(m_form) switch(m_form)
@ -909,7 +910,7 @@ void Pet::UpdateResistances(uint32 school)
Unit *owner = GetOwner(); Unit *owner = GetOwner();
// hunter and warlock pets gain 40% of owner's resistance // hunter and warlock pets gain 40% of owner's resistance
if(owner && (getPetType() == HUNTER_PET || getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)) if(owner && (getPetType() == HUNTER_PET || (getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)))
value += float(owner->GetResistance(SpellSchools(school))) * 0.4f; value += float(owner->GetResistance(SpellSchools(school))) * 0.4f;
SetResistance(SpellSchools(school), int32(value)); SetResistance(SpellSchools(school), int32(value));
@ -926,7 +927,7 @@ void Pet::UpdateArmor()
Unit *owner = GetOwner(); Unit *owner = GetOwner();
// hunter and warlock pets gain 35% of owner's armor value // hunter and warlock pets gain 35% of owner's armor value
if(owner && (getPetType() == HUNTER_PET || getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)) if(owner && (getPetType() == HUNTER_PET || (getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)))
bonus_armor = 0.35f * float(owner->GetArmor()); bonus_armor = 0.35f * float(owner->GetArmor());
value = GetModifierValue(unitMod, BASE_VALUE); value = GetModifierValue(unitMod, BASE_VALUE);

View file

@ -592,7 +592,7 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket)
// check cheating, can't fail with correct client operations // check cheating, can't fail with correct client operations
Item* item = _player->GetItemByPos(bag,slot); Item* item = _player->GetItemByPos(bag,slot);
if(!item || tradeSlot!=TRADE_SLOT_NONTRADED && !item->CanBeTraded()) if (!item || (tradeSlot != TRADE_SLOT_NONTRADED && !item->CanBeTraded()))
{ {
SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); SendTradeStatus(TRADE_STATUS_TRADE_CANCELED);
return; return;

View file

@ -6500,7 +6500,6 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
{ {
if ((*i)->GetModifier()->m_miscvalue == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113) if ((*i)->GetModifier()->m_miscvalue == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113)
{ {
int32 value2 = CalculateSpellDamage((*i)->GetSpellProto(),2,(*i)->GetSpellProto()->EffectBasePoints[2],this);
// Drain Soul // Drain Soul
CastCustomSpell(this, 18371, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura); CastCustomSpell(this, 18371, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura);
break; break;

View file

@ -692,9 +692,9 @@ struct SpellPeriodicAuraLogInfo
Aura *aura; Aura *aura;
uint32 damage; uint32 damage;
uint32 overDamage; // overkill/overheal
uint32 absorb; uint32 absorb;
uint32 resist; uint32 resist;
uint32 overDamage; // overkill/overheal
float multiplier; float multiplier;
bool critical; bool critical;
}; };

View file

@ -312,7 +312,7 @@ void WaypointManager::CheckTextsExistance(std::set<int32>& ids)
WaypointPathMap::const_iterator pmItr = m_pathMap.begin(); WaypointPathMap::const_iterator pmItr = m_pathMap.begin();
for ( ; pmItr != m_pathMap.end(); ++pmItr) for ( ; pmItr != m_pathMap.end(); ++pmItr)
{ {
for (int i = 0; i < pmItr->second.size(); ++i) for (size_t i = 0; i < pmItr->second.size(); ++i)
{ {
WaypointBehavior* be = pmItr->second[i].behavior; WaypointBehavior* be = pmItr->second[i].behavior;
if (!be) if (!be)

View file

@ -310,7 +310,7 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
return; return;
uint32 map0 = i_mapIds[0]; uint32 map0 = i_mapIds[0];
for(int i = 1; i < i_mapIds.size(); ++i) for (size_t i = 1; i < i_mapIds.size(); ++i)
{ {
if(i_mapIds[i]!=map0) if(i_mapIds[i]!=map0)
{ {

View file

@ -597,14 +597,14 @@ void WorldSession::LoadAccountData(QueryResult* result, uint32 mask)
if (type >= NUM_ACCOUNT_DATA_TYPES) if (type >= NUM_ACCOUNT_DATA_TYPES)
{ {
sLog.outError("Table `%s` have invalid account data type (%u), ignore.", sLog.outError("Table `%s` have invalid account data type (%u), ignore.",
mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data"); mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
continue; continue;
} }
if ((mask & (1 << type))==0) if ((mask & (1 << type))==0)
{ {
sLog.outError("Table `%s` have non appropriate for table account data type (%u), ignore.", sLog.outError("Table `%s` have non appropriate for table account data type (%u), ignore.",
mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data"); mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
continue; continue;
} }
@ -887,4 +887,4 @@ void WorldSession::SetPlayer( Player *plr )
// set m_GUID that can be used while player loggined and later until m_playerRecentlyLogout not reset // set m_GUID that can be used while player loggined and later until m_playerRecentlyLogout not reset
if(_player) if(_player)
m_GUIDLow = _player->GetGUIDLow(); m_GUIDLow = _player->GetGUIDLow();
} }

View file

@ -293,10 +293,6 @@ int Master::Run()
uint32 socketSelecttime = sWorld.getConfig(CONFIG_SOCKET_SELECTTIME); uint32 socketSelecttime = sWorld.getConfig(CONFIG_SOCKET_SELECTTIME);
// maximum counter for next ping
uint32 numLoops = (sConfig.GetIntDefault( "MaxPingTime", 30 ) * (MINUTE * 1000000 / socketSelecttime));
uint32 loopCounter = 0;
///- Start up freeze catcher thread ///- Start up freeze catcher thread
if(uint32 freeze_delay = sConfig.GetIntDefault("MaxCoreStuckTime", 0)) if(uint32 freeze_delay = sConfig.GetIntDefault("MaxCoreStuckTime", 0))
{ {

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8474" #define REVISION_NR "8475"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__