aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/BattleGround.cpp3
-rw-r--r--src/game/BattleGroundAB.cpp4
-rw-r--r--src/game/BattleGroundMgr.h2
-rw-r--r--src/game/Chat.cpp2
-rw-r--r--src/game/Creature.cpp10
-rw-r--r--src/game/CreatureEventAI.cpp2
-rw-r--r--src/game/GameObject.cpp1
-rw-r--r--src/game/GridNotifiers.h2
-rw-r--r--src/game/Guild.h26
-rw-r--r--src/game/GuildHandler.cpp2
-rw-r--r--src/game/Level0.cpp4
-rw-r--r--src/game/Level1.cpp4
-rw-r--r--src/game/Level2.cpp6
-rw-r--r--src/game/Level3.cpp8
-rw-r--r--src/game/LootHandler.cpp4
-rw-r--r--src/game/Map.cpp7
-rw-r--r--src/game/MotionMaster.cpp2
-rw-r--r--src/game/MovementHandler.cpp4
-rw-r--r--src/game/ObjectMgr.cpp14
-rw-r--r--src/game/Player.cpp66
-rw-r--r--src/game/Player.h3
-rw-r--r--src/game/PoolHandler.cpp6
-rw-r--r--src/game/SocialMgr.cpp4
-rw-r--r--src/game/Spell.cpp1
-rw-r--r--src/game/SpellAuras.cpp9
-rw-r--r--src/game/SpellAuras.h1
-rw-r--r--src/game/SpellMgr.h10
-rw-r--r--src/game/StatSystem.cpp25
-rw-r--r--src/game/TradeHandler.cpp2
-rw-r--r--src/game/Unit.cpp16
-rw-r--r--src/game/Unit.h2
-rw-r--r--src/game/WaypointMovementGenerator.cpp2
-rw-r--r--src/game/WorldSession.cpp4
-rw-r--r--src/trinitycore/Master.cpp4
34 files changed, 113 insertions, 149 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index 7163a9874f8..8ac19588b7c 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -1906,6 +1906,5 @@ WorldSafeLocsEntry const* BattleGround::GetClosestGraveYard( Player* player )
bool BattleGround::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const
{
BattleGroundTeamId team_idx = GetTeamIndexByTeamId(team);
- uint32 score = (m_TeamScores[team_idx] < 0) ? 0 : uint32(m_TeamScores[team_idx]);
- return score >= minScore && score <= maxScore;
+ return m_TeamScores[team_idx] >= minScore && m_TeamScores[team_idx] <= maxScore;
}
diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp
index adf480d6f97..a6e9e9b97d7 100644
--- a/src/game/BattleGroundAB.cpp
+++ b/src/game/BattleGroundAB.cpp
@@ -689,8 +689,8 @@ bool BattleGroundAB::IsAllNodesConrolledByTeam(uint32 team) const
{
uint32 count = 0;
for(int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
- if ((team == ALLIANCE && m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED) ||
- (team == HORDE && m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED))
+ if (team == ALLIANCE && m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED ||
+ team == HORDE && m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED)
++count;
return count == BG_AB_DYNAMIC_NODES_COUNT;
diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h
index 1b07676ddfc..dbf68dc1d31 100644
--- a/src/game/BattleGroundMgr.h
+++ b/src/game/BattleGroundMgr.h
@@ -149,8 +149,8 @@ class BGQueueInviteEvent : public BasicEvent
private:
uint64 m_PlayerGuid;
uint32 m_BgInstanceGUID;
+ uint32 m_RemoveTime;
BattleGroundTypeId m_BgTypeId;
- uint32 m_RemoveTime;
};
/*
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 41cdac7c7d2..068d524b9ad 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -1274,7 +1274,7 @@ valid examples:
char c = reader.peek();
// ignore enchants etc.
- while ((c >= '0' && c <= '9') || c== ':')
+ while(c >='0' && c <='9' || c==':')
{
reader.ignore(1);
c = reader.peek();
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 01eeb234159..a04ec449fbd 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -247,7 +247,7 @@ void Creature::SearchFormationAndPath()
void Creature::RemoveCorpse()
{
- if ((getDeathState() != CORPSE && !m_isDeadByDefault) || (getDeathState() != ALIVE && m_isDeadByDefault))
+ if( getDeathState()!=CORPSE && !m_isDeadByDefault || getDeathState()!=ALIVE && m_isDeadByDefault )
return;
m_deathTimer = 0;
@@ -1736,10 +1736,10 @@ float Creature::GetAttackDistance(Unit const* pl) const
if(aggroRate==0)
return 0.0f;
- uint32 playerlevel = pl->getLevelForTarget(this);
- uint32 creaturelevel = getLevelForTarget(pl);
+ int32 playerlevel = pl->getLevelForTarget(this);
+ int32 creaturelevel = getLevelForTarget(pl);
- int32 leveldif = int32(playerlevel) - int32(creaturelevel);
+ int32 leveldif = playerlevel - creaturelevel;
// "The maximum Aggro Radius has a cap of 25 levels under. Example: A level 30 char has the same Aggro Radius of a level 5 char on a level 60 mob."
if ( leveldif < - 25)
@@ -2027,7 +2027,7 @@ bool Creature::IsVisibleInGridForPlayer(Player const* pl) const
{
if( GetEntry() == VISUAL_WAYPOINT && !pl->isGameMaster() )
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
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp
index bf606c6c488..b7795dc3927 100644
--- a/src/game/CreatureEventAI.cpp
+++ b/src/game/CreatureEventAI.cpp
@@ -381,7 +381,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
target = owner;
}
}
- else if ((target = m_creature->getVictim()))
+ else if (target = m_creature->getVictim())
{
if (target->GetTypeId() != TYPEID_PLAYER)
if (Unit* owner = target->GetOwner())
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 18a80ce46fe..c60ec02bab9 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -402,7 +402,6 @@ void GameObject::Update(uint32 /*p_time*/)
if (GetGOInfo()->GetAutoCloseTime() && (m_cooldownTime < time(NULL)))
ResetDoorOrButton();
break;
- default: break;
}
break;
}
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h
index 399e50def3f..e11e1210ff5 100644
--- a/src/game/GridNotifiers.h
+++ b/src/game/GridNotifiers.h
@@ -1224,7 +1224,7 @@ namespace Trinity
~LocalizedPacketListDo()
{
for(size_t i = 0; i < i_data_cache.size(); ++i)
- for(size_t j = 0; j < i_data_cache[i].size(); ++j)
+ for(int j = 0; j < i_data_cache[i].size(); ++j)
delete i_data_cache[i][j];
}
void operator()( Player* p );
diff --git a/src/game/Guild.h b/src/game/Guild.h
index 7a715be8911..0e70ed53fd0 100644
--- a/src/game/Guild.h
+++ b/src/game/Guild.h
@@ -297,19 +297,19 @@ class Guild
uint32 GetId(){ return m_Id; }
const uint64& GetLeader(){ return m_LeaderGuid; }
- std::string const& GetName() const { return m_Name; }
- std::string const& GetMOTD() const { return MOTD; }
- std::string const& GetGINFO() const { return GINFO; }
-
- uint32 GetCreatedYear() const { return m_CreatedYear; }
- uint32 GetCreatedMonth() const { return m_CreatedMonth; }
- uint32 GetCreatedDay() const { return m_CreatedDay; }
-
- uint32 GetEmblemStyle() const { return m_EmblemStyle; }
- uint32 GetEmblemColor() const { return m_EmblemColor; }
- uint32 GetBorderStyle() const { return m_BorderStyle; }
- uint32 GetBorderColor() const { return m_BorderColor; }
- uint32 GetBackgroundColor() const { return m_BackgroundColor; }
+ std::string GetName(){ return m_Name; }
+ std::string GetMOTD(){ return MOTD; }
+ std::string GetGINFO(){ return GINFO; }
+
+ uint32 GetCreatedYear(){ return m_CreatedYear; }
+ uint32 GetCreatedMonth(){ return m_CreatedMonth; }
+ uint32 GetCreatedDay(){ return m_CreatedDay; }
+
+ uint32 GetEmblemStyle(){ return m_EmblemStyle; }
+ uint32 GetEmblemColor(){ return m_EmblemColor; }
+ uint32 GetBorderStyle(){ return m_BorderStyle; }
+ uint32 GetBorderColor(){ return m_BorderColor; }
+ uint32 GetBackgroundColor(){ return m_BackgroundColor; }
void SetLeader(uint64 guid);
bool AddMember(uint64 plGuid, uint32 plRank);
diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp
index c11ad11766b..4b163c09e85 100644
--- a/src/game/GuildHandler.cpp
+++ b/src/game/GuildHandler.cpp
@@ -1074,7 +1074,7 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data )
recv_data >> unk2; // always 0
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
return;
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
index 2692fdbe953..efc09494d1d 100644
--- a/src/game/Level0.cpp
+++ b/src/game/Level0.cpp
@@ -149,7 +149,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
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();
return true;
@@ -164,7 +164,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
for(; itr != m.end(); ++itr)
{
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())))
{
if(first)
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index f9adcf1dbaf..2f0579b3d1d 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -2736,7 +2736,7 @@ bool ChatHandler::HandleGoTaxinodeCommand(const char* args)
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))
{
PSendSysMessage(LANG_INVALID_TARGET_COORD,node->x,node->y,node->map_id);
@@ -2873,7 +2873,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
float y = (float)atof(py);
// 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;
uint32 areaid = cAreaId ? (uint32)atoi(cAreaId) : _player->GetZoneId();
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index eadd6bc1cf5..5e545fa5a41 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -3066,7 +3066,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
return false;
}
- sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u", wpCreature->GetGUIDLow());
+ sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u");
// set "wpguid" column to the visual waypoint
WorldDatabase.PExecuteLog("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point);
@@ -3670,6 +3670,8 @@ void ChatHandler::HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id)
bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/)
{
+ uint32 classmask = m_session->GetPlayer()->getClassMask();
+
for (uint32 i = 0; i < sSkillLineStore.GetNumRows(); ++i)
{
SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(i);
@@ -3712,6 +3714,8 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
// converting string that we try to find to lower case
wstrToLower( wnamepart );
+ uint32 classmask = m_session->GetPlayer()->getClassMask();
+
std::string name;
SkillLineEntry const *targetSkillInfo = NULL;
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 488b28ff280..025a367528c 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -5438,7 +5438,7 @@ bool ChatHandler::HandleServerRestartCommand(const char* args)
int32 time = atoi (time_str);
///- 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;
if (exitcode_str)
@@ -5473,7 +5473,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char* args)
int32 time = atoi (time_str);
///- 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;
if (exitcode_str)
@@ -5508,7 +5508,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char* args)
int32 time = atoi (time_str);
///- 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;
if (exitcode_str)
@@ -7068,7 +7068,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
}
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);
SetSentErrorMessage(true);
diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp
index 63e7308e340..7a7f78fb90a 100644
--- a/src/game/LootHandler.cpp
+++ b/src/game/LootHandler.cpp
@@ -47,7 +47,7 @@ void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
GameObject *go = player->GetMap()->GetGameObject(lguid);
// 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);
return;
@@ -292,7 +292,7 @@ void WorldSession::DoLootRelease( uint64 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
- 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;
loot = &go->loot;
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 2fba8c37d2c..4c6dbba2e90 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -1870,8 +1870,7 @@ uint16 Map::GetAreaFlag(float x, float y, float z) const
// Makers' Overlook (ground and cave)
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;
// The Makers' Perch (underground)
@@ -1950,7 +1949,7 @@ void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 area
bool Map::IsInWater(float x, float y, float pZ, float min_depth) const
{
// Check surface in x, y point for liquid
- if (const_cast<Map*>(this)->GetGrid(x, y))
+ if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
{
LiquidData liquid_status;
if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, &liquid_status))
@@ -1964,7 +1963,7 @@ bool Map::IsInWater(float x, float y, float pZ, float min_depth) const
bool Map::IsUnderWater(float x, float y, float z) const
{
- if (const_cast<Map*>(this)->GetGrid(x, y))
+ if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
{
if (getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN)&LIQUID_MAP_UNDER_WATER)
return true;
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp
index 0c6aa44ad1d..d77bd83ede2 100644
--- a/src/game/MotionMaster.cpp
+++ b/src/game/MotionMaster.cpp
@@ -95,7 +95,7 @@ MotionMaster::UpdateMotion(uint32 diff)
if (m_expList)
{
- for (size_t i = 0; i < m_expList->size(); ++i)
+ for (int i = 0; i < m_expList->size(); ++i)
{
MovementGenerator* mg = (*m_expList)[i];
DirectDelete(mg);
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp
index 00a783190e9..40be00327f5 100644
--- a/src/game/MovementHandler.cpp
+++ b/src/game/MovementHandler.cpp
@@ -485,7 +485,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
}
else
{
- 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 " I64FMT " and should be " I64FMT, guid, _player->m_mover->GetGUID());
GetPlayer()->SetMover(GetPlayer());
}
}
@@ -499,7 +499,7 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data)
/*if(_player->m_mover->GetGUID() == old_mover_guid)
{
- sLog.outError("HandleMoveNotActiveMover: incorrect mover guid: mover is " I64FMT " and should be " I64FMT " instead of " UI64FMTD, _player->m_mover->GetGUID(), _player->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);
recv_data.rpos(recv_data.wpos()); // prevent warnings spam
return;
}*/
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 9054969b733..2f4bad688ef 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -115,7 +115,7 @@ bool SpellClickInfo::IsFitToRequirements(Player const* player, Creature const *
if(questStart)
{
// 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;
}
@@ -878,8 +878,8 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const*
// replace by new structures array
const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()/2+1];
- uint32 i=0;
- for(uint32 j = 0; j < val.size()/2; ++j)
+ int i=0;
+ for(uint32 j=0;j<val.size()/2;++j)
{
CreatureDataAddonAura& cAura = const_cast<CreatureDataAddonAura&>(addon->auras[i]);
cAura.spell_id = (uint32)val[2*j+0];
@@ -1301,7 +1301,7 @@ void ObjectMgr::LoadCreatures()
if(heroicCreatures.find(data.id)!=heroicCreatures.end())
{
- sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as heroic template (entry: %u) in `creature_template`, skipped.",guid,data.id );
+ sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as heroic template in `creature_template_substitution`, skipped.",guid,data.id );
continue;
}
@@ -3823,8 +3823,8 @@ void ObjectMgr::LoadQuests()
bool found = false;
for(uint8 k = 0; k < 3; ++k)
{
- if ((spellInfo->Effect[k] == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->EffectMiscValue[k]) == qinfo->QuestId) ||
- spellInfo->Effect[k] == SPELL_EFFECT_SEND_EVENT)
+ if( spellInfo->Effect[k]==SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->EffectMiscValue[k])==qinfo->QuestId ||
+ spellInfo->Effect[k]==SPELL_EFFECT_SEND_EVENT)
{
found = true;
break;
@@ -7631,7 +7631,7 @@ bool PlayerCondition::Meets(Player const * player) const
case CONDITION_REPUTATION_RANK:
{
FactionEntry const* faction = sFactionStore.LookupEntry(value1);
- return faction && player->GetReputationMgr().GetRank(faction) >= int32(value2);
+ return faction && player->GetReputationMgr().GetRank(faction) >= value2;
}
case CONDITION_TEAM:
return player->GetTeam() == value1;
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index b1b27b2dda1..43a98ddc7b4 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -448,7 +448,6 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_baseSpellPower = 0;
m_baseFeralAP = 0;
m_baseManaRegen = 0;
- m_armorPenetrationPct = 0.0f;
// Honor System
m_lastHonorUpdateTime = time(NULL);
@@ -853,9 +852,9 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
void Player::SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, int32 Regen)
{
- if (int(MaxValue) == DISABLED_MIRROR_TIMER)
+ if (MaxValue == DISABLED_MIRROR_TIMER)
{
- if (int(CurrentValue) != DISABLED_MIRROR_TIMER)
+ if (CurrentValue!=DISABLED_MIRROR_TIMER)
StopMirrorTimer(Type);
return;
}
@@ -1578,7 +1577,7 @@ bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
if(!enchantId)
continue;
- if ((enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)))
+ if(enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId))
break;
}
@@ -2398,8 +2397,9 @@ bool Player::IsGroupVisibleFor(Player* p) const
bool Player::IsInSameGroupWith(Player const* p) const
{
- return (p==this || (GetGroup() != NULL &&
- GetGroup()->SameSubGroup((Player*)this, (Player*)p)));
+ return p==this || GetGroup() != NULL &&
+ GetGroup() == p->GetGroup() &&
+ GetGroup()->SameSubGroup((Player*)this, (Player*)p);
}
///- If the player is invited, remove him. If the group if then only 1 person, disband the group.
@@ -3281,7 +3281,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 ||
// 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))
{
@@ -3362,7 +3362,7 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const
{
// 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
- 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
return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState)));
@@ -3404,7 +3404,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
if (itr == m_spells.end())
return;
- if(itr->second->state == PLAYERSPELL_REMOVED || (disabled && itr->second->disabled) || itr->second->state == PLAYERSPELL_TEMPORARY)
+ if(itr->second->state == PLAYERSPELL_REMOVED || disabled && itr->second->disabled || itr->second->state == PLAYERSPELL_TEMPORARY)
return;
// unlearn non talent higher ranks (recursive)
@@ -3521,7 +3521,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 &&
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
- ((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
if ((pSkill->categoryId==SKILL_CATEGORY_SECONDARY || pSkill->categoryId==SKILL_CATEGORY_PROFESSION) &&
@@ -4768,7 +4768,7 @@ void Player::RepopAtGraveyard()
AreaTableEntry const *zone = GetAreaEntryByAreaID(GetAreaId());
// 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() || GetPositionZ() < -500.0f)
+ if(!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY || GetTransport() || GetPositionZ() < -500.0f)
{
ResurrectPlayer(0.5f);
SpawnCorpseBones();
@@ -7091,7 +7091,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 (ssv)
{
- if ((extraDPS = ssv->getDPSMod(proto->ScalingStatValue)))
+ if (extraDPS = ssv->getDPSMod(proto->ScalingStatValue))
{
float average = extraDPS * proto->Delay / 1000.0f;
minDamage = 0.7f * average;
@@ -9009,10 +9009,10 @@ Item* Player::GetItemByPos( uint16 pos ) 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];
- else if ((bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)
- || (bag >= BANK_SLOT_BAG_START && bag < BANK_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 *pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, bag );
if ( pBag )
@@ -10996,15 +10996,9 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
// update expertise and armor penetration - passive auras may need it
if( slot == EQUIPMENT_SLOT_MAINHAND )
- {
UpdateExpertise(BASE_ATTACK);
- UpdateArmorPenetration();
- }
else if( slot == EQUIPMENT_SLOT_OFFHAND )
- {
UpdateExpertise(OFF_ATTACK);
- UpdateArmorPenetration();
- }
switch(slot)
{
@@ -11154,13 +11148,9 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
}
UpdateExpertise(BASE_ATTACK);
- UpdateArmorPenetration();
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
- {
UpdateExpertise(OFF_ATTACK);
- UpdateArmorPenetration();
- }
// update armor penetration - passive auras may need it
switch(slot)
{
@@ -11289,16 +11279,10 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
break;
}
- if( slot == EQUIPMENT_SLOT_MAINHAND )
- {
+ if ( slot == EQUIPMENT_SLOT_MAINHAND )
UpdateExpertise(BASE_ATTACK);
- UpdateArmorPenetration();
- }
else if( slot == EQUIPMENT_SLOT_OFFHAND )
- {
UpdateExpertise(OFF_ATTACK);
- UpdateArmorPenetration();
- }
// equipment visual show
SetVisibleItemSlot(slot, NULL);
@@ -11677,7 +11661,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
if(IsEquipmentPos ( src ) || IsBagPos ( src ))
{
// 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)
{
SendEquipError( msg, pSrcItem, pDstItem );
@@ -11707,7 +11691,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
if(IsEquipmentPos ( dst ) || IsBagPos ( dst ))
{
// 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)
{
SendEquipError( msg, pSrcItem, pDstItem );
@@ -12125,7 +12109,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
Item* item = *itr;
++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);
}
}
@@ -14763,7 +14747,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// check name limitations
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;
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid);
@@ -17947,7 +17931,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
uint32 mount_display_id = objmgr.GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == NULL);
// 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);
data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR);
@@ -20408,8 +20392,8 @@ void Player::UpdateCorpseReclaimDelay()
{
bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH;
- if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
- (!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
+ if( pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP) ||
+ !pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) )
return;
time_t now = time(NULL);
@@ -20445,8 +20429,8 @@ void Player::SendCorpseReclaimDelay(bool load)
return;
uint32 count;
- if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
- (!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
+ if( pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP) ||
+ !pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) )
{
count = (m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
if(count>=MAX_DEATH_COUNT)
diff --git a/src/game/Player.h b/src/game/Player.h
index 449e0be40e8..ec58459bea0 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1699,7 +1699,6 @@ class MANGOS_DLL_SPEC Player : public Unit
void UpdateSpellCritChance(uint32 school);
void UpdateArmorPenetration(int32 amount);
void UpdateExpertise(WeaponAttackType attType);
- void UpdateArmorPenetration();
void ApplyManaRegenBonus(int32 amount, bool apply);
void UpdateManaRegen();
@@ -1866,7 +1865,6 @@ class MANGOS_DLL_SPEC Player : public Unit
float GetTotalPercentageModValue(BaseModGroup modGroup) const { return m_auraBaseMod[modGroup][FLAT_MOD] + m_auraBaseMod[modGroup][PCT_MOD]; }
void _ApplyAllStatBonuses();
void _RemoveAllStatBonuses();
- float GetArmorPenetrationPct() const { return m_armorPenetrationPct; }
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply);
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
@@ -2355,7 +2353,6 @@ Spell * m_spellModTakingSpell;
uint16 m_baseSpellPower;
uint16 m_baseFeralAP;
uint16 m_baseManaRegen;
- float m_armorPenetrationPct;
SpellModList m_spellMods[MAX_SPELLMOD];
uint32 m_pad;
diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp
index d02b5b695fc..dd0834b80f4 100644
--- a/src/game/PoolHandler.cpp
+++ b/src/game/PoolHandler.cpp
@@ -100,7 +100,7 @@ uint32 PoolGroup<T>::RollOne(void)
template<class T>
void PoolGroup<T>::DespawnObject(uint32 guid)
{
- for (size_t i=0; i < EqualChanced.size(); ++i)
+ for (int i=0; i<EqualChanced.size(); ++i)
{
if (EqualChanced[i].spawned)
{
@@ -189,7 +189,7 @@ void PoolGroup<T>::SpawnObject(uint32 limit, bool cache)
else if (limit < EqualChanced.size() && Spawned < limit)
{
std::vector<uint32> IndexList;
- for (size_t i=0; i < EqualChanced.size(); ++i)
+ for (int i=0; i<EqualChanced.size(); ++i)
if (!EqualChanced[i].spawned)
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
{
- for (size_t i = 0; i < EqualChanced.size(); ++i)
+ for (int i=0; i<EqualChanced.size(); ++i)
EqualChanced[i].spawned = Spawn1Object(EqualChanced[i].guid);
}
}
diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp
index 2331b7ad839..d94cd422f11 100644
--- a/src/game/SocialMgr.cpp
+++ b/src/game/SocialMgr.cpp
@@ -208,7 +208,7 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
if (pFriend && pFriend->GetName() &&
(security > SEC_PLAYER ||
- ((pFriend->GetTeam() == team || allowTwoSideWhoList) && (pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList))) &&
+ (pFriend->GetTeam() == team || allowTwoSideWhoList) && (pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList)) &&
pFriend->IsVisibleGloballyFor(player))
{
friendInfo.Status = FRIEND_STATUS_ONLINE;
@@ -287,7 +287,7 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
if (pFriend && pFriend->IsInWorld() &&
(pFriend->GetSession()->GetSecurity() > SEC_PLAYER ||
- ((pFriend->GetTeam() == team || allowTwoSideWhoList) && security <= gmLevelInWhoList)) &&
+ (pFriend->GetTeam() == team || allowTwoSideWhoList) && security <= gmLevelInWhoList) &&
player->IsVisibleGloballyFor(pFriend))
{
pFriend->GetSession()->SendPacket(packet);
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index fbe5bce42d7..5944dd08df3 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -5363,7 +5363,6 @@ SpellCastResult Spell::CheckCasterAuras() const
else if ( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
return SPELL_FAILED_SILENCED;
break;
- default: break;
}
}
}
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index e9027764b7d..34a3ea2347d 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -333,7 +333,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNoImmediateEffect, //277 SPELL_AURA_MOD_ABILITY_AFFECTED_TARGETS implemented in spell::settargetmap
&Aura::HandleAuraModDisarm, //278 SPELL_AURA_MOD_DISARM_RANGED disarm ranged weapon
&Aura::HandleAuraInitializeImages, //279 SPELL_AURA_INITIALIZE_IMAGES
- &Aura::HandleModTargetArmorPct, //280 SPELL_AURA_MOD_TARGET_ARMOR_PCT
+ &Aura::HandleNoImmediateEffect, //280 SPELL_AURA_MOD_TARGET_ARMOR_PCT implemented in Unit::CalcArmorReducedDamage
&Aura::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor
&Aura::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
&Aura::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus
@@ -6998,10 +6998,3 @@ bool AuraEffect::IsPeriodicTickCrit(Unit const * pCaster) const
return false;
}
-void Aura::HandleModTargetArmorPct(bool apply, bool Real)
-{
- if(m_target->GetTypeId() != TYPEID_PLAYER)
- return;
-
- ((Player*)m_target)->UpdateArmorPenetration();
-}
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 1c5c485291b..4fe680f26fc 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -333,7 +333,6 @@ class TRINITY_DLL_SPEC AuraEffect
void HandleAuraCloneCaster(bool Apply, bool Real, bool changeAmount);
void HandleAuraModCritPct(bool Apply, bool Real, bool changeAmount);
void HandleAuraLinked(bool Apply, bool Real, bool changeAmount);
- void HandleModTargetArmorPct(bool Apply, bool Real);
void HandleAuraEffectSpecificMods(bool apply, bool Real, bool changeAmount);
int32 CalculateCrowdControlAuraAmount(Unit * caster);
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 1745b2572bc..f9ec824e668 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -239,16 +239,16 @@ inline bool IsElementalShield(SpellEntry const *spellInfo)
inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo)
{
- return ((spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM
- && spellInfo->Effect[1] == SPELL_EFFECT_SCRIPT_EFFECT)
- || spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0==SPELL_EFFECT_SCRIPT_EFFECT without any other data)
+ return spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM
+ && spellInfo->Effect[1] == SPELL_EFFECT_SCRIPT_EFFECT
+ || spellInfo->Id == 64323; // Book of Glyph Mastery (Effect0==SPELL_EFFECT_SCRIPT_EFFECT without any other data)
}
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)
- (spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121));
+ spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121;
}
bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2);
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index a55f0bb47c3..d991a96ebe6 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -151,7 +151,6 @@ bool Player::UpdateAllStats()
UpdateAllSpellCritChances();
UpdateDefenseBonusesMod();
UpdateShieldBlockValue();
- UpdateArmorPenetration();
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
UpdateExpertise(BASE_ATTACK);
@@ -687,30 +686,6 @@ void Player::UpdateExpertise(WeaponAttackType attack)
}
}
-void Player::UpdateArmorPenetration()
-{
- m_armorPenetrationPct = GetRatingBonusValue(CR_ARMOR_PENETRATION);
-
- AuraList const& armorAuras = GetAurasByType(SPELL_AURA_MOD_TARGET_ARMOR_PCT);
- for(AuraList::const_iterator itr = armorAuras.begin(); itr != armorAuras.end(); ++itr)
- {
- // affects all weapons
- if((*itr)->GetSpellProto()->EquippedItemClass == -1)
- {
- m_armorPenetrationPct += (*itr)->GetModifier()->m_amount;
- continue;
- }
-
- // dependent on weapon class
- for(uint8 i = 0; i < MAX_ATTACK; ++i)
- {
- Item *weapon = GetWeaponForAttack(WeaponAttackType(i));
- if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
- m_armorPenetrationPct += (*itr)->GetModifier()->m_amount;
- }
- }
-}
-
void Player::ApplyManaRegenBonus(int32 amount, bool apply)
{
m_baseManaRegen+= apply ? amount : -amount;
diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp
index 3044e8a3b51..66781c1b63b 100644
--- a/src/game/TradeHandler.cpp
+++ b/src/game/TradeHandler.cpp
@@ -594,7 +594,7 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket)
// check cheating, can't fail with correct client operations
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);
return;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 5fec651dd47..dac9f91a16e 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1671,9 +1671,21 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
}
}
- // Apply Player CR_ARMOR_PENETRATION rating and percent talents
+ // Apply Player CR_ARMOR_PENETRATION rating
if (GetTypeId()==TYPEID_PLAYER)
- armor *= 1.0f - ((Player*)this)->GetArmorPenetrationPct() / 100.0f;
+ {
+ float maxArmorPen=0;
+ if (getLevel()<60)
+ maxArmorPen=400+85*pVictim->getLevel();
+ else
+ maxArmorPen=400+85*pVictim->getLevel()+4.5*85*(pVictim->getLevel()-59);
+ // Cap armor penetration to this number
+ maxArmorPen = std::min(((armor+maxArmorPen)/3),armor);
+ // Figure out how much armor do we ignore
+ float armorPen = maxArmorPen*((Player*)this)->GetRatingBonusValue(CR_ARMOR_PENETRATION) / 100.0f;
+ // Got the value, apply it
+ armor -= armorPen;
+ }
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_ARMOR_PCT
//armor *= 1.0f - GetTotalAuraModifier(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT) / 100.0f;
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 566c2fb6a1b..4a62568f613 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -852,9 +852,9 @@ struct SpellPeriodicAuraLogInfo
AuraEffect *auraEff;
uint32 damage;
- uint32 overDamage; // overkill/overheal
uint32 absorb;
uint32 resist;
+ uint32 overDamage; // overkill/overheal
float multiplier;
bool critical;
};
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index de8f075ea38..8e5b8a501ff 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -306,7 +306,7 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
return;
uint32 map0 = i_mapIds[0];
- for (size_t i = 1; i < i_mapIds.size(); ++i)
+ for(int i = 1; i < i_mapIds.size(); ++i)
{
if(i_mapIds[i]!=map0)
{
diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp
index 93e3937e168..4cb251d6524 100644
--- a/src/game/WorldSession.cpp
+++ b/src/game/WorldSession.cpp
@@ -603,14 +603,14 @@ void WorldSession::LoadAccountData(QueryResult* result, uint32 mask)
if (type >= NUM_ACCOUNT_DATA_TYPES)
{
sLog.outError("Table `%s` have invalid account data type (%u), ignore.",
- mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
+ mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data");
continue;
}
if ((mask & (1 << type))==0)
{
sLog.outError("Table `%s` have non appropriate for table account data type (%u), ignore.",
- mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
+ mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data");
continue;
}
diff --git a/src/trinitycore/Master.cpp b/src/trinitycore/Master.cpp
index 94c5a4cc023..b8c51461a67 100644
--- a/src/trinitycore/Master.cpp
+++ b/src/trinitycore/Master.cpp
@@ -307,6 +307,10 @@ int Master::Run()
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
if(uint32 freeze_delay = sConfig.GetIntDefault("MaxCoreStuckTime", 0))
{