aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorSpp <none@none>2010-08-30 15:25:15 +0200
committerSpp <none@none>2010-08-30 15:25:15 +0200
commit405f312918136510fde921403ffffa315bdbcb4b (patch)
tree1543ab9fe023fcb6ce03d31070917cff527b2e88 /src/server/game
parentb0d85ac1858ecc162adb08a8de1b3da68121ce64 (diff)
Core: Fix more warnings
--HG-- branch : trunk
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp2
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.cpp2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp8
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.h10
-rw-r--r--src/server/game/Chat/Commands/TicketCommands.cpp2
-rw-r--r--src/server/game/DataStores/DBCStores.cpp2
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp2
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.cpp2
-rw-r--r--src/server/game/Entities/Item/Item.cpp2
-rw-r--r--src/server/game/Entities/Object/Object.cpp3
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp2
-rw-r--r--src/server/game/Entities/Player/Player.cpp8
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp16
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp37
-rw-r--r--src/server/game/Events/GameEventMgr.cpp9
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp34
-rw-r--r--src/server/game/Groups/Group.cpp13
-rw-r--r--src/server/game/Guilds/Guild.cpp4
-rw-r--r--src/server/game/Instances/InstanceScript.cpp13
-rw-r--r--src/server/game/Maps/Map.cpp4
-rw-r--r--src/server/game/Maps/MapInstanced.cpp9
-rw-r--r--src/server/game/Pools/PoolMgr.cpp2
-rw-r--r--src/server/game/Scripting/ScriptLoader.cpp6
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp4
-rw-r--r--src/server/game/Scripting/ScriptSystem.cpp18
-rw-r--r--src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp2
-rw-r--r--src/server/game/Server/Protocol/Handlers/GuildHandler.cpp2
-rw-r--r--src/server/game/Server/Protocol/Handlers/MiscHandler.cpp4
-rw-r--r--src/server/game/Server/Protocol/Handlers/MovementHandler.cpp32
-rw-r--r--src/server/game/Server/Protocol/Handlers/NPCHandler.cpp2
-rw-r--r--src/server/game/Server/Protocol/Handlers/PetHandler.cpp2
-rw-r--r--src/server/game/Server/Protocol/Handlers/TicketHandler.cpp4
-rw-r--r--src/server/game/Server/Protocol/Handlers/TradeHandler.cpp6
-rw-r--r--src/server/game/Server/WorldSession.cpp2
-rw-r--r--src/server/game/Server/WorldSocket.cpp2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp28
-rw-r--r--src/server/game/Spells/Spell.cpp10
-rw-r--r--src/server/game/Spells/SpellEffects.cpp40
-rw-r--r--src/server/game/World/World.cpp21
39 files changed, 203 insertions, 168 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 9cea85b6dec..22748095d7a 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -481,7 +481,7 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID,
//disable npcflags
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
- sLog.outDebug("TSCR: EscortAI started with %u waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
+ sLog.outDebug("TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
CurrentWP = WaypointList.begin();
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index 2941b067e79..1c630a1b10d 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -32,7 +32,7 @@ void ArenaTeamMember::ModifyPersonalRating(Player* plr, int32 mod, uint32 slot)
plr->SetArenaTeamInfoField(slot, ARENA_TEAM_PERSONAL_RATING, personal_rating);
}
-void ArenaTeamMember::ModifyMatchmakerRating(int32 mod, uint32 slot)
+void ArenaTeamMember::ModifyMatchmakerRating(int32 mod, uint32 /*slot*/)
{
if (int32(matchmaker_rating) + mod < 0)
matchmaker_rating = 0;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index a3801590191..f69ca79e7b6 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -44,7 +44,7 @@ BattlegroundAV::~BattlegroundAV()
{
}
-const uint16 BattlegroundAV::GetBonusHonor(uint8 kills) //TODO: move this function to Battleground.cpp (needs to find a way to get m_MaxLevel)
+uint16 BattlegroundAV::GetBonusHonor(uint8 kills) //TODO: move this function to Battleground.cpp (needs to find a way to get m_MaxLevel)
{
return Trinity::Honor::hk_honor_at_level(m_MaxLevel, kills);
}
@@ -795,7 +795,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
DelCreature(node + 302);//NULL checks are in DelCreature! 0-302 spirit guides
}
-const BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
+BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
{
sLog.outDebug("bg_AV getnodethroughobject %i",object);
if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER)
@@ -817,7 +817,7 @@ const BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
return BG_AV_Nodes(0);
}
-const uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
+uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
{ //this function is the counterpart to GetNodeThroughObject()
sLog.outDebug("bg_AV GetObjectThroughNode %i",node);
if (m_Nodes[node].Owner == ALLIANCE)
@@ -1101,7 +1101,7 @@ void BattlegroundAV::FillInitialWorldStates(WorldPacket& data)
SendMineWorldStates(AV_SOUTH_MINE);
}
-const uint8 BattlegroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used for node worldstates and returns values which fit good into the worldstatesarray
+uint8 BattlegroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used for node worldstates and returns values which fit good into the worldstatesarray
{
//neutral stuff cant get handled (currently its only snowfall)
ASSERT(team != AV_NEUTRAL_TEAM);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
index 09524b08c55..67a322251d2 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
@@ -1582,23 +1582,23 @@ class BattlegroundAV : public Battleground
void PopulateNode(BG_AV_Nodes node);
void DePopulateNode(BG_AV_Nodes node);
- const BG_AV_Nodes GetNodeThroughObject(uint32 object);
- const uint32 GetObjectThroughNode(BG_AV_Nodes node);
+ BG_AV_Nodes GetNodeThroughObject(uint32 object);
+ uint32 GetObjectThroughNode(BG_AV_Nodes node);
const char* GetNodeName(BG_AV_Nodes node);
- const bool IsTower(BG_AV_Nodes node) { return m_Nodes[node].Tower; }
+ bool IsTower(BG_AV_Nodes node) { return m_Nodes[node].Tower; }
/*mine*/
void ChangeMineOwner(uint8 mine, uint32 team, bool initial=false);
/*worldstates*/
void FillInitialWorldStates(WorldPacket& data);
- const uint8 GetWorldStateType(uint8 state, uint16 team);
+ uint8 GetWorldStateType(uint8 state, uint16 team);
void SendMineWorldStates(uint32 mine);
void UpdateNodeWorldState(BG_AV_Nodes node);
/*general */
Creature* AddAVCreature(uint16 cinfoid, uint16 type);
- const uint16 GetBonusHonor(uint8 kills); //TODO remove this when the core handles this right
+ uint16 GetBonusHonor(uint8 kills); //TODO remove this when the core handles this right
/*variables */
int32 m_Team_Scores[2];
diff --git a/src/server/game/Chat/Commands/TicketCommands.cpp b/src/server/game/Chat/Commands/TicketCommands.cpp
index fc1db823a68..6393ea93d3c 100644
--- a/src/server/game/Chat/Commands/TicketCommands.cpp
+++ b/src/server/game/Chat/Commands/TicketCommands.cpp
@@ -102,7 +102,7 @@ bool ChatHandler::HandleGMTicketListClosedCommand(const char* /*args*/)
return true;
}
-bool ChatHandler::HandleGMTicketListEscalatedCommand(const char* args)
+bool ChatHandler::HandleGMTicketListEscalatedCommand(const char* /*args*/)
{
SendSysMessage(LANG_COMMAND_TICKETSHOWESCALATEDLIST);
for (GmTicketList::iterator itr = sTicketMgr.m_GMTicketList.begin(); itr != sTicketMgr.m_GMTicketList.end(); ++itr)
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index d9d5695cc94..c390f2203e2 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -34,7 +34,7 @@ typedef std::map<uint32,uint32> AreaFlagByMapID;
struct WMOAreaTableTripple
{
- WMOAreaTableTripple(int32 r, int32 a, int32 g) : rootId(r), adtId(a), groupId(g)
+ WMOAreaTableTripple(int32 r, int32 a, int32 g) : groupId(g), rootId(r), adtId(a)
{
}
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 727ffef5708..4535e9853ad 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -2360,7 +2360,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
time_t ptime = time(NULL);
- if (vCount->lastIncrementTime + vItem->incrtime <= ptime)
+ if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime)
{
ItemPrototype const* pProto = sObjectMgr.GetItemPrototype(vItem->item);
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 33598c6b39c..20d3806cc18 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -295,7 +295,7 @@ void Minion::RemoveFromWorld()
bool Minion::IsGuardianPet() const
{
- return isPet() || m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET;
+ return isPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
}
Guardian::Guardian(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner)
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 4e615052cba..ab54522de7a 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1000,7 +1000,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
bool Item::IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) const
{
ItemPrototype const* proto = GetProto();
- return proto && (proto->Map && proto->Map != cur_mapId || proto->Area && proto->Area != cur_zoneId);
+ return proto && ((proto->Map && proto->Map != cur_mapId) || (proto->Area && proto->Area != cur_zoneId));
}
// Though the client has the information in the item's data field,
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 13a648d131d..271a523a611 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -2370,8 +2370,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
float step = dist/10.0f;
- int j = 0;
- for (j; j < 10; j++)
+ for (uint8 j = 0; j < 10; ++j)
{
// do not allow too big z changes
if (fabs(pos.m_positionZ - destz) > 6)
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 87ac7627f96..7286512bce6 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -615,7 +615,7 @@ void Creature::Regenerate(Powers power)
// Apply modifiers (if any).
AuraEffectList const& ModPowerRegenPCTAuras = GetAuraEffectsByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for (AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
- if ((*i)->GetMiscValue() == power)
+ if (Powers((*i)->GetMiscValue()) == power)
addvalue *= ((*i)->GetAmount() + 100) / 100.0f;
addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * (isHunterPet()? PET_FOCUS_REGEN_INTERVAL : CREATURE_REGEN_INTERVAL) / (5 * IN_MILLISECONDS);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 06b5a7fd33b..322899f8b74 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -2237,7 +2237,7 @@ void Player::Regenerate(Powers power)
{
AuraEffectList const& ModPowerRegenPCTAuras = GetAuraEffectsByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for (AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
- if ((*i)->GetMiscValue() == power)
+ if (Powers((*i)->GetMiscValue()) == power)
addvalue *= ((*i)->GetAmount() + 100) / 100.0f;
// Butchery requires combat for this effect
@@ -17484,7 +17484,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_MAP, target_map, this))
{
- GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_INSTANCE_CLOSED));
+ GetSession()->SendAreaTriggerMessage("%s", GetSession()->GetTrinityString(LANG_INSTANCE_CLOSED));
return false;
}
@@ -17505,7 +17505,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
if (report)
{
if (missingQuest && !ar->questFailedText.empty())
- ChatHandler(GetSession()).PSendSysMessage(ar->questFailedText.c_str());
+ ChatHandler(GetSession()).PSendSysMessage("%s", ar->questFailedText.c_str());
else if (mapDiff->hasErrorMessage) // if (missingAchievement) covered by this case
SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty);
else if (missingItem)
@@ -18256,7 +18256,7 @@ void Player::SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint
<< "',position_z='"<<z<<"',orientation='"<<o<<"',map='"<<mapid
<< "',zone='"<<zone<<"',trans_x='0',trans_y='0',trans_z='0',"
<< "transguid='0',taxi_path='' WHERE guid='"<< GUID_LOPART(guid) <<"'";
- sLog.outDebug(ss.str().c_str());
+ sLog.outDebug("%s", ss.str().c_str());
CharacterDatabase.Execute(ss.str().c_str());
}
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index e6e588e1b59..0de9be51480 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -155,10 +155,10 @@ void Player::UpdateSpellDamageAndHealingBonus()
bool Player::UpdateAllStats()
{
- for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
+ for (int8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
{
float value = GetTotalStatValue(Stats(i));
- SetStat(Stats(i), (int32)value);
+ SetStat(Stats(i), int32(value));
}
UpdateArmor();
@@ -166,7 +166,7 @@ bool Player::UpdateAllStats()
UpdateAttackPowerAndDamage(true);
UpdateMaxHealth();
- for (int i = POWER_MANA; i < MAX_POWERS; ++i)
+ for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
UpdateAllRatings();
@@ -790,10 +790,10 @@ bool Creature::UpdateAllStats()
UpdateAttackPowerAndDamage();
UpdateAttackPowerAndDamage(true);
- for (int i = POWER_MANA; i < MAX_POWERS; ++i)
+ for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
- for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
+ for (int8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
@@ -1036,13 +1036,13 @@ bool Guardian::UpdateStats(Stats stat)
bool Guardian::UpdateAllStats()
{
- for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
+ for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
UpdateStats(Stats(i));
- for (int i = POWER_MANA; i < MAX_POWERS; ++i)
+ for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
- for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
+ for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 96a8e798696..74f5b5f469a 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -3274,7 +3274,11 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
// weapon skill or (unarmed for base attack and fist weapons)
- uint32 skill = item && item->GetSkill() != SKILL_FIST_WEAPONS ? item->GetSkill() : SKILL_UNARMED;
+ uint32 skill;
+ if (item && item->GetSkill() != SKILL_FIST_WEAPONS)
+ skill = item->GetSkill();
+ else
+ skill = SKILL_UNARMED;
// in PvP use full skill instead current skill value
value = (target && target->IsControlledByPlayer())
@@ -7350,9 +7354,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
{
if (ToPlayer()->HasSpellCooldown(16166))
{
- uint32 newCooldownDelay = ToPlayer()->GetSpellCooldownDelay(16166) - 2;
- if (newCooldownDelay < 0) newCooldownDelay = 0;
- ToPlayer()->AddSpellCooldown(16166,0, uint32(time(NULL) + newCooldownDelay));
+ uint32 newCooldownDelay = ToPlayer()->GetSpellCooldownDelay(16166);
+ if (newCooldownDelay < 3)
+ newCooldownDelay = 0;
+ else
+ newCooldownDelay -= 2;
+ ToPlayer()->AddSpellCooldown(16166,0, uint32(time(NULL) + newCooldownDelay));
WorldPacket data(SMSG_MODIFY_COOLDOWN, 4+8+4);
data << uint32(16166); // Spell ID
@@ -9636,7 +9643,7 @@ Guardian* Unit::GetGuardianPet() const
if (pet->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
return (Guardian*)pet;
- sLog.outCrash("Unit::GetGuardianPet: Guardian " I64FMT " not exist.", pet_guid);
+ sLog.outCrash("Unit::GetGuardianPet: Guardian " UI64FMTD " not exist.", pet_guid);
const_cast<Unit*>(this)->SetPetGUID(0);
}
@@ -9848,7 +9855,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
if (GetTypeId() == TYPEID_PLAYER)
{
if (!AddUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
- sLog.outCrash("Player %s is trying to charm unit %u, but it already has a charmed unit %u", GetName(), charm->GetEntry(), GetCharmGUID());
+ sLog.outCrash("Player %s is trying to charm unit %u, but it already has a charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
charm->m_ControlledByPlayer = true;
// TODO: maybe we can use this flag to check if controlled by player
@@ -9861,7 +9868,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
if (!charm->AddUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
- sLog.outCrash("Unit %u is being charmed, but it already has a charmer %u", charm->GetEntry(), charm->GetCharmerGUID());
+ sLog.outCrash("Unit %u is being charmed, but it already has a charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
{
@@ -9876,11 +9883,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
if (GetTypeId() == TYPEID_PLAYER)
{
if (!RemoveUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
- sLog.outCrash("Player %s is trying to uncharm unit %u, but it has another charmed unit %u", GetName(), charm->GetEntry(), GetCharmGUID());
+ sLog.outCrash("Player %s is trying to uncharm unit %u, but it has another charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
}
if (!charm->RemoveUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
- sLog.outCrash("Unit %u is being uncharmed, but it has another charmer %u", charm->GetEntry(), charm->GetCharmerGUID());
+ sLog.outCrash("Unit %u is being uncharmed, but it has another charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
if (charm->GetTypeId() == TYPEID_PLAYER)
{
@@ -10011,11 +10018,11 @@ void Unit::RemoveAllControlled()
sLog.outError("Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
}
if (GetPetGUID())
- sLog.outCrash("Unit %u is not able to release its pet " I64FMT, GetEntry(), GetPetGUID());
+ sLog.outCrash("Unit %u is not able to release its pet " UI64FMTD, GetEntry(), GetPetGUID());
if (GetMinionGUID())
- sLog.outCrash("Unit %u is not able to release its minion " I64FMT, GetEntry(), GetMinionGUID());
+ sLog.outCrash("Unit %u is not able to release its minion " UI64FMTD, GetEntry(), GetMinionGUID());
if (GetCharmGUID())
- sLog.outCrash("Unit %u is not able to release its charm " I64FMT, GetEntry(), GetCharmGUID());
+ sLog.outCrash("Unit %u is not able to release its charm " UI64FMTD, GetEntry(), GetCharmGUID());
}
Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
@@ -11117,7 +11124,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
if (spellProto->Effect[j] == SPELL_EFFECT_HEALTH_LEECH ||
- spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH)
+ (spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH))
{
CastingTime /= 2;
break;
@@ -14718,7 +14725,7 @@ void Unit::SetContestedPvP(Player *attackedPlayer)
{
Player* player = GetCharmerOrOwnerPlayerOrPlayerItself();
- if (!player || (attackedPlayer && (attackedPlayer == player || player->duel && player->duel->opponent == attackedPlayer)))
+ if (!player || (attackedPlayer && (attackedPlayer == player || (player->duel && player->duel->opponent == attackedPlayer))))
return;
player->SetContestedPvPTimer(30000);
@@ -15179,7 +15186,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
// only if not player and not controlled by player pet. And not at BG
if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
{
- sLog.outStaticDebug("We are dead, losing %u percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
+ sLog.outStaticDebug("We are dead, losing %f percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH));
pVictim->ToPlayer()->DurabilityLossAll(sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH),false);
// durability lost message
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index 8ed647ca364..d1d91f44354 100644
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -79,7 +79,12 @@ uint32 GameEventMgr::NextCheck(uint16 entry) const
// for CONDITIONS state world events, return the length of the wait period, so if the conditions are met, this check will be called again to set the timer as NEXTPHASE event
if (mGameEvent[entry].state == GAMEEVENT_WORLD_CONDITIONS)
- return mGameEvent[entry].length ? mGameEvent[entry].length * 60 : max_ge_check_delay;
+ {
+ if (mGameEvent[entry].length)
+ return mGameEvent[entry].length * 60 ;
+ else
+ return max_ge_check_delay;
+ }
// outdated event: we return max
if (currenttime > mGameEvent[entry].end)
@@ -1710,7 +1715,7 @@ bool IsHolidayActive(HolidayIds id)
GameEventMgr::ActiveEvents const& ae = sGameEventMgr.GetActiveEventList();
for (GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr)
- if (events[*itr].holiday_id == uint32(id))
+ if (events[*itr].holiday_id == id)
return true;
return false;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index e9fec505d22..c733c434f9d 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -848,7 +848,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo)
if (cInfo->expansion > (MAX_CREATURE_BASE_HP - 1))
{
- sLog.outErrorDb("Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->expansion);
+ sLog.outErrorDb("Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion);
const_cast<CreatureInfo*>(cInfo)->expansion = 0;
}
@@ -1186,7 +1186,7 @@ void ObjectMgr::LoadCreatureLinkedRespawn()
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outErrorDb(">> Loaded 0 linked respawns. DB table `creature_linked_respawn` is empty.");
return;
}
@@ -1207,7 +1207,7 @@ void ObjectMgr::LoadCreatureLinkedRespawn()
} while (result->NextRow());
sLog.outString();
- sLog.outString(">> Loaded %u linked respawns", mCreatureLinkedRespawnMap.size());
+ sLog.outString(">> Loaded " UI64FMTD " linked respawns", uint64(mCreatureLinkedRespawnMap.size()));
}
bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid)
@@ -2447,7 +2447,7 @@ void ObjectMgr::LoadItemSetNameLocales()
} while (result->NextRow());
sLog.outString();
- sLog.outString(">> Loaded %lu Item set name locale strings", (uint32)mItemSetNameLocaleMap.size());
+ sLog.outString(">> Loaded " UI64FMTD " Item set name locale strings", uint64(mItemSetNameLocaleMap.size()));
}
void ObjectMgr::LoadItemSetNames()
@@ -2764,7 +2764,7 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
bool found = false;
for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x)
{
- if (entry->ItemId[x] == itemId)
+ if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId)
{
found = true;
const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0;
@@ -3103,16 +3103,11 @@ void ObjectMgr::LoadPlayerInfo()
continue;
}
- uint8 current_level = fields[1].GetUInt8();
+ uint8 current_level = fields[1].GetUInt8(); // Can't be > than STRONG_MAX_LEVEL (hardcoded level maximum) due to var type
if (current_level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
- if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
- sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
- else
- {
- sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.",current_level);
- ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
- }
+ sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.",current_level);
+ ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
continue;
}
@@ -4961,7 +4956,7 @@ void ObjectMgr::LoadSpellScriptNames()
if (allRanks)
{
- if (sSpellMgr.GetFirstSpellInChain(spellId) != spellId)
+ if (sSpellMgr.GetFirstSpellInChain(spellId) != uint32(spellId))
{
sLog.outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.",scriptName,fields[0].GetInt32());
continue;
@@ -5079,7 +5074,7 @@ void ObjectMgr::LoadPageTexts()
ss << *itr << " ";
ss << "create(s) a circular reference, which can cause the server to freeze. Changing Next_Page of page "
<< pageItr->Page_ID <<" to 0";
- sLog.outErrorDb(ss.str().c_str());
+ sLog.outErrorDb("%s", ss.str().c_str());
const_cast<PageText*>(pageItr)->Next_Page = 0;
break;
}
@@ -6987,7 +6982,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
void ObjectMgr::LoadPointsOfInterest()
{
mPointsOfInterest.clear(); // need for reload case
-
+
uint32 count = 0;
// 0 1 2 3 4 5 6
@@ -7039,7 +7034,7 @@ void ObjectMgr::LoadPointsOfInterest()
void ObjectMgr::LoadQuestPOI()
{
mQuestPOIMap.clear(); // need for reload case
-
+
uint32 count = 0;
// 0 1 2 3
@@ -8857,7 +8852,7 @@ void ObjectMgr::LoadCreatureClassLevelStats()
{
Field *fields = result->Fetch();
- uint8 Level = fields[0].GetUInt32();
+ uint8 Level = fields[0].GetUInt8();
uint8 Class = fields[1].GetUInt8();
CreatureBaseStats stats;
@@ -8866,13 +8861,14 @@ void ObjectMgr::LoadCreatureClassLevelStats()
stats.BaseMana = fields[5].GetUInt32();
stats.BaseArmor = fields[6].GetUInt32();
+/* With uint8 Level can't be greater than STRONG_MAX_LEVEL
if (Level > STRONG_MAX_LEVEL)
{
sLog.outErrorDb("Creature base stats for class %u has invalid level %u (max is %u) - set to %u",
Class, Level, STRONG_MAX_LEVEL, STRONG_MAX_LEVEL);
Level = STRONG_MAX_LEVEL;
}
-
+*/
if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0)
sLog.outErrorDb("Creature base stats for level %u has invalid class %u",
Level, Class);
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index f7cde3ae6ff..01ea1e82572 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1109,7 +1109,6 @@ void Group::SendUpdate()
data << uint8(citr->flags);
if (isLFGGroup())
{
- uint32 lowguid = GetLowGUID();
data << uint8(1);
data << uint8(m_LfgStatus);
data << uint32(m_LfgDungeonEntry);
@@ -1728,7 +1727,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
{
InstanceSave *p = itr->second.save;
const MapEntry *entry = sMapStore.LookupEntry(itr->first);
- if (!entry || entry->IsRaid() != isRaid || !p->CanReset() && method != INSTANCE_RESET_GROUP_DISBAND)
+ if (!entry || entry->IsRaid() != isRaid || (!p->CanReset() && method != INSTANCE_RESET_GROUP_DISBAND))
{
++itr;
continue;
@@ -1791,7 +1790,7 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
Difficulty difficulty = GetDifficulty(aMap->IsRaid());
// some instances only have one difficulty
- MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(aMap->GetId(),difficulty);
+ GetDownscaledMapDifficultyData(aMap->GetId(),difficulty);
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId());
if (itr != m_boundInstances[difficulty].end())
@@ -1808,7 +1807,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
Difficulty difficulty = GetDifficulty(mapEntry->IsRaid());
// some instances only have one difficulty
- MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(mapEntry->MapID,difficulty);
+ GetDownscaledMapDifficultyData(mapEntry->MapID,difficulty);
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID);
if (itr != m_boundInstances[difficulty].end())
@@ -1882,8 +1881,8 @@ void Group::ResetMaxEnchantingLevel()
Player *pMember = NULL;
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
- if (pMember = sObjectMgr.GetPlayer(citr->guid))
- if (m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING))
- m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING);
+ pMember = sObjectMgr.GetPlayer(citr->guid);
+ if (pMember && m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING))
+ m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING);
}
}
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 4d342d99475..d1562c08334 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -158,7 +158,7 @@ bool Guild::AddMember(uint64 plGuid, uint32 plRank)
newmember.Class = fields[3].GetUInt8();
newmember.accountId = fields[4].GetInt32();
- if (newmember.Level < 1 || newmember.Level > STRONG_MAX_LEVEL ||
+ if (newmember.Level < 1 || //newmember.Level > STRONG_MAX_LEVEL ||
newmember.Class < CLASS_WARRIOR || newmember.Class >= MAX_CLASSES)
{
sLog.outError("Player (GUID: %u) has a broken data in field `characters` table, cannot add him to guild.",GUID_LOPART(plGuid));
@@ -403,7 +403,7 @@ bool Guild::LoadMembersFromDB(QueryResult_AutoPtr guildMembersResult)
newmember.accountId = fields[24].GetInt32();
//this code will remove unexisting character guids from guild
- if (newmember.Level < 1 || newmember.Level > STRONG_MAX_LEVEL) // can be at broken `data` field
+ if (newmember.Level < 1 /*|| newmember.Level > STRONG_MAX_LEVEL*/) // can be at broken `data` field
{
sLog.outError("Player (GUID: %u) has a broken data in field `characters`.`data`, deleting him from guild!",GUID_LOPART(guid));
CharacterDatabase.PExecute("DELETE FROM guild_member WHERE guid = '%u'", GUID_LOPART(guid));
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index e881128f049..7644fa16868 100644
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -64,7 +64,7 @@ void InstanceScript::LoadMinionData(const MinionData *data)
++data;
}
- sLog.outDebug("InstanceScript::LoadMinionData: %u minions loaded.", doors.size());
+ sLog.outDebug("InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size()));
}
void InstanceScript::LoadDoorData(const DoorData *data)
@@ -76,7 +76,7 @@ void InstanceScript::LoadDoorData(const DoorData *data)
++data;
}
- sLog.outDebug("InstanceScript::LoadDoorData: %u doors loaded.", doors.size());
+ sLog.outDebug("InstanceScript::LoadDoorData: " UI64FMTD " doors loaded.", uint64(doors.size()));
}
void InstanceScript::UpdateMinionState(Creature *minion, EncounterState state)
@@ -306,10 +306,17 @@ void InstanceScript::DoSendNotifyToInstance(const char *format, ...)
InstanceMap::PlayerList::const_iterator i;
if (!PlayerList.isEmpty())
+ {
+ va_list ap;
+ va_start(ap, format);
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
if (Player *pPlayer = i->getSource())
if (WorldSession *pSession = pPlayer->GetSession())
- pSession->SendNotification(format);
+ pSession->SendNotification(format, ap);
+ }
+ va_end(ap);
+ }
}
// Complete Achievement for all players in instance
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 331257ca673..880044ff760 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -749,13 +749,13 @@ Map::Remove(T *obj, bool remove)
CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
- sLog.outError("Map::Remove: Object " I64FMT " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
+ sLog.outError("Map::Remove: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
else
{
Cell cell(p);
if (loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)))
{
- sLog.outStaticDebug("Remove object " I64FMT " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y);
+ sLog.outStaticDebug("Remove object " UI64FMTD " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(grid != NULL);
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index eb138e66818..fbeeb06019a 100644
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -188,7 +188,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save,
}
// some instances only have one difficulty
- MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(GetId(),difficulty);
+ GetDownscaledMapDifficultyData(GetId(),difficulty);
sLog.outDebug("MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal");
@@ -211,7 +211,12 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),bg->GetMinLevel());
- uint8 spawnMode = bracketEntry ? bracketEntry->difficulty : REGULAR_DIFFICULTY;
+ uint8 spawnMode;
+
+ if (bracketEntry)
+ spawnMode = bracketEntry->difficulty;
+ else
+ spawnMode = REGULAR_DIFFICULTY;
BattlegroundMap *map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode);
ASSERT(map->IsBattlegroundOrArena());
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp
index c8b14943c7f..8b40b41a1ef 100644
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -639,7 +639,7 @@ void PoolMgr::LoadFromDB()
ss << *itr << " ";
ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool "
<< poolItr->first << " and child pool " << poolItr->second;
- sLog.outErrorDb(ss.str().c_str());
+ sLog.outErrorDb("%s", ss.str().c_str());
mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first);
mPoolSearchMap.erase(poolItr);
--count;
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 2378db7dff3..0a7eb686d02 100644
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -1130,19 +1130,19 @@ void AddOutdoorPvPScripts()
AddSC_outdoorpvp_si();
AddSC_outdoorpvp_tf();
AddSC_outdoorpvp_zm();
-#endif SCRIPTS
+#endif
}
void AddBattlegroundScripts()
{
#ifdef SCRIPTS
-#endif SCRIPTS
+#endif
}
#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
-#endif SCRIPTS
+#endif
void AddCustomScripts()
{
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index bdff47bc74c..860ec673b4f 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -182,7 +182,7 @@ void ScriptMgr::Initialize()
sLog.outString("Loading C++ scripts");
barGoLink bar(1);
bar.step();
- sLog.outString("");
+ sLog.outString();
FillSpellSummary();
AddScripts();
@@ -855,7 +855,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
return tmpscript->OnTrigger(player, trigger);
}
-Battleground* ScriptMgr::CreateBattleground(BattlegroundTypeId typeId)
+Battleground* ScriptMgr::CreateBattleground(BattlegroundTypeId /*typeId*/)
{
// TODO: Implement script-side battlegrounds.
ASSERT(false);
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index 54a14228bc1..d642faa3f3f 100644
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -44,12 +44,12 @@ void SystemMgr::LoadVersion()
Field* pFields = Result->Fetch();
sLog.outString("TSCR: Database version is: %s", pFields[0].GetString());
- sLog.outString("");
+ sLog.outString();
}
else
{
sLog.outError("TSCR: Missing `version`.`script_version` information.");
- sLog.outString("");
+ sLog.outString();
}
}
@@ -107,14 +107,14 @@ void SystemMgr::LoadScriptTexts()
++uiCount;
} while (Result->NextRow());
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded %u additional Script Texts data.", uiCount);
}
else
{
barGoLink bar(1);
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty.");
}
}
@@ -173,14 +173,14 @@ void SystemMgr::LoadScriptTextsCustom()
++uiCount;
} while (Result->NextRow());
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded %u additional Custom Texts data.", uiCount);
}
else
{
barGoLink bar(1);
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty.");
}
}
@@ -197,7 +197,7 @@ void SystemMgr::LoadScriptWaypoints()
if (Result)
uiCreatureCount = Result->GetRowCount();
- sLog.outString("TSCR: Loading Script Waypoints for %u creature(s)...", uiCreatureCount);
+ sLog.outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount);
Result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid");
@@ -235,14 +235,14 @@ void SystemMgr::LoadScriptWaypoints()
++uiNodeCount;
} while (Result->NextRow());
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded %u Script Waypoint nodes.", uiNodeCount);
}
else
{
barGoLink bar(1);
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
}
}
diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
index 87786c27ac2..e8b50a073f3 100644
--- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
@@ -682,7 +682,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
// send new char string if not empty
if (!sWorld.GetNewCharString().empty())
- chH.PSendSysMessage(sWorld.GetNewCharString().c_str());
+ chH.PSendSysMessage("%s", sWorld.GetNewCharString().c_str());
}
}
diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp
index 0fd3c04b359..1114ec353b2 100644
--- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp
@@ -1032,7 +1032,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
recv_data >> SplitedAmount;
}
- if (BankTabSlot >= GUILD_BANK_MAX_SLOTS && BankTabSlot != 0xFF ||
+ if ((BankTabSlot >= GUILD_BANK_MAX_SLOTS && BankTabSlot != 0xFF) ||
BankTab >= pGuild->GetPurchasedTabs())
{
recv_data.rpos(recv_data.wpos()); // prevent additional spam at rejected packet
diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp
index 7947ea9ce2c..e5025aa5bd0 100644
--- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp
@@ -746,7 +746,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data)
return;
// prevent resurrect before 30-sec delay after body release not finished
- if (corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP) > time_t(time(NULL)))
+ if (time_t(corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(time(NULL)))
return;
if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true))
@@ -1421,7 +1421,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data)
_player->SetSeer(_player);
break;
case 1:
- sLog.outDebug("Added FarSight " I64FMT " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow());
+ sLog.outDebug("Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow());
if (WorldObject *target = _player->GetViewpoint())
_player->SetSeer(target);
else
diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp
index f147b26e376..e81cc59e0ff 100644
--- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp
@@ -499,21 +499,23 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
recv_data >> guid;
if (GetPlayer()->IsInWorld())
- if (Unit *mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
- {
- GetPlayer()->SetMover(mover);
- if (mover != GetPlayer() && mover->canFly())
- {
- WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
- data.append(mover->GetPackGUID());
- data << uint32(0);
- SendPacket(&data);
- }
- }
- else
{
- sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID());
- GetPlayer()->SetMover(GetPlayer());
+ if (Unit *mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
+ {
+ GetPlayer()->SetMover(mover);
+ if (mover != GetPlayer() && mover->canFly())
+ {
+ WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
+ data.append(mover->GetPackGUID());
+ data << uint32(0);
+ SendPacket(&data);
+ }
+ }
+ else
+ {
+ sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID());
+ GetPlayer()->SetMover(GetPlayer());
+ }
}
}
@@ -653,7 +655,7 @@ void WorldSession::HandleEjectPasenger(WorldPacket &data)
{
if (data.GetOpcode() == CMSG_EJECT_PASSENGER)
{
- if (Vehicle* Vv= _player->GetVehicleKit())
+ if (_player->GetVehicleKit())
{
uint64 guid;
data >> guid;
diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
index aa05a964ebe..b79d046ed35 100644
--- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
@@ -569,7 +569,7 @@ void WorldSession::SendStablePetCallback(QueryResult_AutoPtr result, uint64 guid
while (result->NextRow());
}
- data.put<uint8>(sizeof(uint64), num); // set real data to placeholder
+ data.put<uint8>(wpos, num); // set real data to placeholder
SendPacket(&data);
}
diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp
index 85ef8826771..18193b51a2b 100644
--- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp
@@ -37,7 +37,7 @@ void WorldSession::HandleDismissCritter(WorldPacket &recv_data)
uint64 guid;
recv_data >> guid;
- sLog.outDebug("WORLD: Received CMSG_DISMISS_CRITTER for GUID %u", guid);
+ sLog.outDebug("WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD "", guid);
Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
diff --git a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp b/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp
index 8d6f8a13294..0eb4baf10fc 100644
--- a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp
@@ -36,7 +36,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
return;
}
- if (GM_Ticket *ticket = sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()))
+ if (sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID()))
{
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
data << uint32(GMTICKET_RESPONSE_FAILURE); // You already have GM ticket
@@ -291,7 +291,7 @@ void WorldSession::HandleReportLag(WorldPacket& recv_data)
CharacterDatabase.Execute(os.str().c_str());
}
-void WorldSession::HandleGMResponseResolve(WorldPacket& recvPacket)
+void WorldSession::HandleGMResponseResolve(WorldPacket& /*recvPacket*/)
{
// empty packet
GM_Ticket* ticket = sTicketMgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp
index 6cf31f5da59..4ae4a3dc76b 100644
--- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp
@@ -92,8 +92,6 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/)
data << uint32(view_trade->GetMoney()); // trader gold
data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item
- Item *item = NULL;
-
for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
{
data << uint8(i); // trade slot number, if not specified, then end of packet
@@ -327,7 +325,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
Item* castItem = my_trade->GetSpellCastItem();
if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) ||
- my_trade->HasSpellCastItem() && !castItem)
+ (my_trade->HasSpellCastItem() && !castItem))
{
clearAcceptTradeMode(my_trade, his_trade);
clearAcceptTradeMode(myItems, hisItems);
@@ -361,7 +359,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
SpellEntry const* spellEntry = sSpellStore.LookupEntry(his_spell_id);
Item* castItem = his_trade->GetSpellCastItem();
- if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || his_trade->HasSpellCastItem() && !castItem)
+ if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || (his_trade->HasSpellCastItem() && !castItem))
{
delete my_spell;
his_trade->SetSpell(0);
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index 936137c2e88..8b3c8a06b2c 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -166,7 +166,7 @@ void WorldSession::LogUnprocessedTail(WorldPacket *packet)
sLog.outError("SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)",
LookupOpcodeName(packet->GetOpcode()),
packet->GetOpcode(),
- packet->rpos(),packet->wpos());
+ uint32(packet->rpos()), uint32(packet->wpos()));
packet->print_storage();
}
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index 667473aa3f4..2e9151a2bf4 100644
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -718,7 +718,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
sScriptMgr.OnPacketReceive(this, WorldPacket(*new_pct));
return HandleAuthSession (*new_pct);
case CMSG_KEEP_ALIVE:
- sLog.outStaticDebug ("CMSG_KEEP_ALIVE ,size: %d", new_pct->size());
+ sLog.outStaticDebug ("CMSG_KEEP_ALIVE ,size: " UI64FMTD, uint64(new_pct->size()));
sScriptMgr.OnPacketReceive(this, WorldPacket(*new_pct));
return 0;
default:
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 2fc836c76ca..228b4dcadad 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1228,7 +1228,7 @@ bool AuraEffect::IsPeriodicTickCrit(Unit * target, Unit const * caster) const
return true;
}
// Rupture - since 3.3.3 can crit
- if (AuraEffect *AuraRupture = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0x0, 0x0, caster->GetGUID()))
+ if (target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0x0, 0x0, caster->GetGUID()))
{
if (caster->isSpellCrit(target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
return true;
@@ -1604,7 +1604,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
}
case SPELL_AURA_PERIODIC_MANA_LEECH:
{
- if (GetMiscValue() < 0 || GetMiscValue() >= MAX_POWERS)
+ if (GetMiscValue() < 0 || GetMiscValue() >= int8(MAX_POWERS))
break;
Powers power = Powers(GetMiscValue());
@@ -1739,7 +1739,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
case SPELL_AURA_PERIODIC_ENERGIZE:
{
// ignore non positive values (can be result apply spellmods to aura damage
- if (m_amount < 0 || GetMiscValue() >= MAX_POWERS)
+ if (m_amount < 0 || GetMiscValue() >= int8(MAX_POWERS))
return;
Powers power = Powers(GetMiscValue());
@@ -2599,7 +2599,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const
{
case FORM_CAT:
// Savage Roar
- if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0 , 0x10000000, 0))
+ if (target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0 , 0x10000000, 0))
target->CastSpell(target, 62071, true);
// Nurturing Instinct
if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, SPELLFAMILY_DRUID, 2254, 0))
@@ -2859,12 +2859,22 @@ void AuraEffect::HandlePhase(AuraApplication const * aurApp, uint8 mode, bool ap
// GM-mode have mask 0xFFFFFFFF
if (!target->ToPlayer()->isGameMaster())
- target->SetPhaseMask((apply) ? GetMiscValue() : PHASEMASK_NORMAL,false);
-
- target->ToPlayer()->GetSession()->SendSetPhaseShift((apply) ? GetMiscValue() : PHASEMASK_NORMAL);
+ {
+ if (apply)
+ target->SetPhaseMask(GetMiscValue(), false);
+ else
+ target->SetPhaseMask(PHASEMASK_NORMAL, false);
+ }
+
+ if (apply)
+ target->ToPlayer()->GetSession()->SendSetPhaseShift(GetMiscValue());
+ else
+ target->ToPlayer()->GetSession()->SendSetPhaseShift(PHASEMASK_NORMAL);
}
+ else if (apply)
+ target->SetPhaseMask(GetMiscValue(), false);
else
- target->SetPhaseMask((apply) ? GetMiscValue() : PHASEMASK_NORMAL,false);
+ target->SetPhaseMask(PHASEMASK_NORMAL, false);
// need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
if (target->GetVisibility() != VISIBILITY_OFF)
@@ -6230,7 +6240,7 @@ void AuraEffect::HandleForceReaction(AuraApplication const * aurApp, uint8 mode,
player->GetReputationMgr().SendForceReactions();
// stop fighting if at apply forced rank friendly or at remove real rank friendly
- if (apply && faction_rank >= REP_FRIENDLY || !apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY)
+ if ((apply && faction_rank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY))
player->StopAttackFaction(faction_id);
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 457bc1e019b..af9ad32490f 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2750,7 +2750,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
if (maxSize && power != -1)
{
- if (power == POWER_HEALTH)
+ if (Powers(power) == POWER_HEALTH)
{
if (unitList.size() > maxSize)
{
@@ -4172,7 +4172,7 @@ void Spell::ExecuteLogEffectInterruptCast(uint8 effIndex, Unit * victim, uint32
*m_effectExecuteData[effIndex] << uint32(spellId);
}
-void Spell::ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit * victim, uint32 itemslot, uint32 damage)
+void Spell::ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit * victim, uint32 /*itemslot*/, uint32 damage)
{
InitEffectExecuteData(effIndex);
m_effectExecuteData[effIndex]->append(victim->GetPackGUID());
@@ -5297,7 +5297,7 @@ SpellCastResult Spell::CheckCast(bool strict)
// Can be area effect, Check only for players and not check if target - caster (spell can have multiply drain/burn effects)
if (m_caster->GetTypeId() == TYPEID_PLAYER)
if (Unit* target = m_targets.getUnitTarget())
- if (target != m_caster && target->getPowerType() != m_spellInfo->EffectMiscValue[i])
+ if (target != m_caster && target->getPowerType() != Powers(m_spellInfo->EffectMiscValue[i]))
return SPELL_FAILED_BAD_TARGETS;
break;
}
@@ -6054,7 +6054,7 @@ SpellCastResult Spell::CheckItems()
// Mana Potion, Rage Potion, Thistle Tea(Rogue), ...
if (m_spellInfo->Effect[i] == SPELL_EFFECT_ENERGIZE)
{
- if (m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= int8(MAX_POWERS))
{
failReason = SPELL_FAILED_ALREADY_AT_FULL_POWER;
continue;
@@ -6982,7 +6982,7 @@ void Spell::CalculateDamageDoneForAllTargets()
}
}
-int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *multiplier)
+int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float * /*multiplier*/)
{
int32 damageDone = 0;
unitTarget = unit;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index c38fb902801..749f858e212 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -858,19 +858,19 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
uint32 effect = 0;
uint32 rand = urand(0, 100);
- if (rand >= 0 && rand < 25) // Fireball (25% chance)
+ if (rand < 25) // Fireball (25% chance)
effect = ClearSpellId[0];
- else if (rand >= 25 && rand < 50) // Frostball (25% chance)
+ else if (rand < 50) // Frostball (25% chance)
effect = ClearSpellId[1];
- else if (rand >=50 && rand < 70) // Chain Lighting (25% chance)
+ else if (rand < 70) // Chain Lighting (25% chance)
effect = ClearSpellId[2];
- else if (rand >= 70 && rand < 80) // Polymorph (10% chance)
+ else if (rand < 80) // Polymorph (10% chance)
{
effect = ClearSpellId[3];
if (urand(0, 100) <= 30) // 30% chance to self-cast
unitTarget = m_caster;
}
- else if (rand >=80 && rand < 95) // Enveloping Winds (15% chance)
+ else if (rand < 95) // Enveloping Winds (15% chance)
effect = ClearSpellId[4];
else // Summon Felhund minion (5% chance)
{
@@ -1524,7 +1524,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- if (Item *item = m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
+ if (m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
{
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
if (m_caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
@@ -2193,7 +2193,7 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex)
void Spell::EffectPowerDrain(SpellEffIndex effIndex)
{
- if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= int8(MAX_POWERS))
return;
Powers powerType = Powers(m_spellInfo->EffectMiscValue[effIndex]);
@@ -2247,7 +2247,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
void Spell::EffectPowerBurn(SpellEffIndex effIndex)
{
- if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= int8(MAX_POWERS))
return;
Powers powerType = Powers(m_spellInfo->EffectMiscValue[effIndex]);
@@ -2647,7 +2647,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
if (!unitTarget->isAlive())
return;
- if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= int8(MAX_POWERS))
return;
Powers power = Powers(m_spellInfo->EffectMiscValue[effIndex]);
@@ -2749,7 +2749,7 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex)
if (!unitTarget->isAlive())
return;
- if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= MAX_POWERS)
+ if (m_spellInfo->EffectMiscValue[effIndex] < 0 || m_spellInfo->EffectMiscValue[effIndex] >= int8(MAX_POWERS))
return;
Powers power = Powers(m_spellInfo->EffectMiscValue[effIndex]);
@@ -2837,8 +2837,8 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
{
GameObjectInfo const* goInfo = gameObjTarget->GetGOInfo();
// Arathi Basin banner opening !
- if (goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune ||
- goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK)
+ if ((goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune) ||
+ (goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK))
{
//CanUseBattlegroundObject() already called in CheckCast()
// in battleground check
@@ -4133,7 +4133,7 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex)
totalDamagePercentMod *= (float(unitTarget->GetDiseasesByCaster(m_caster->GetGUID())) * 12.5f + 100.0f) / 100.0f;
// Glyph of Blood Strike
- if (AuraEffect * aurEff = m_caster->GetAuraEffect(59332,0))
+ if (m_caster->GetAuraEffect(59332,0))
{
if (unitTarget->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED))
totalDamagePercentMod *= float((20 + 100.0f) / 100.0f);
@@ -4143,7 +4143,7 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex)
else if (m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
{
// Glyph of Death Strike
- if (AuraEffect * aurEff = m_caster->GetAuraEffect(59336,0))
+ if (m_caster->GetAuraEffect(59336,0))
{
if (uint32 runic = m_caster->GetPower(POWER_RUNIC_POWER))
{
@@ -4304,7 +4304,7 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex)
SpellEntry const* curSpellInfo = spell->m_spellInfo;
// check if we can interrupt spell
if ((spell->getState() == SPELL_STATE_CASTING
- || spell->getState() == SPELL_STATE_PREPARING && spell->GetCastTime() > 0.0f)
+ || (spell->getState() == SPELL_STATE_PREPARING && spell->GetCastTime() > 0.0f))
&& curSpellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT && curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
{
if (m_originalCaster)
@@ -4691,7 +4691,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
uint8 slot = 0;
Item *item = NULL;
- while (bag < 256)
+ while (bag) // 256 = 0 due to var type
{
item = m_caster->ToPlayer()->GetItemByPos(bag, slot);
if (item && item->GetEntry() == 38587) break;
@@ -4702,7 +4702,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
++bag;
}
}
- if (bag < 256)
+ if (bag)
{
if (m_caster->ToPlayer()->GetItemByPos(bag,slot)->GetCount() == 1) m_caster->ToPlayer()->RemoveItem(bag,slot,true);
else m_caster->ToPlayer()->GetItemByPos(bag,slot)->SetCount(m_caster->ToPlayer()->GetItemByPos(bag,slot)->GetCount()-1);
@@ -4754,7 +4754,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 47770:
{
char buf[128];
- char *gender = "his";
+ const char *gender = "his";
if (m_caster->getGender() > 0)
gender = "her";
sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName(), gender, gender, urand(1,10), urand(1,10));
@@ -4765,7 +4765,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 47776:
{
char buf[128];
- char *gender = "his";
+ const char *gender = "his";
if (m_caster->getGender() > 0)
gender = "her";
sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName(), gender, urand(1,6), urand(1,6));
@@ -6936,6 +6936,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *
((Minion*)summon)->SetFollowAngle(m_caster->GetAngle(summon));
if (summon->GetEntry() == 27893)
+ {
if (uint32 weapon = m_caster->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID))
{
summon->SetDisplayId(11686);
@@ -6943,6 +6944,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *
}
else
summon->SetDisplayId(1126);
+ }
summon->AI()->EnterEvadeMode();
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 660fc88679f..8306cd3403d 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1237,13 +1237,14 @@ void World::SetInitialWorldSettings()
///- Check the existence of the map files for all races' startup areas.
if (!MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f)
- ||!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f)
- ||!MapManager::ExistMapAndVMap(1,-618.518f,-4251.67f)
- ||!MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f)
- ||!MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f)
- ||!MapManager::ExistMapAndVMap(1,-2917.58f,-257.98f)
- ||m_int_configs[CONFIG_EXPANSION] && (
- !MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f)))
+ || !MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f)
+ || !MapManager::ExistMapAndVMap(1,-618.518f,-4251.67f)
+ || !MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f)
+ || !MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f)
+ || !MapManager::ExistMapAndVMap(1,-2917.58f,-257.98f)
+ || (m_int_configs[CONFIG_EXPANSION] && (
+ !MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) ||
+ !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f))))
{
sLog.outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.",m_dataPath.c_str(),m_dataPath.c_str());
exit(1);
@@ -1259,7 +1260,11 @@ void World::SetInitialWorldSettings()
//No SQL injection as values are treated as integers
// not send custom type REALM_FFA_PVP to realm list
- uint32 server_type = IsFFAPvPRealm() ? REALM_TYPE_PVP : getIntConfig(CONFIG_GAME_TYPE);
+ uint32 server_type;
+ if (IsFFAPvPRealm())
+ server_type = REALM_TYPE_PVP;
+ else
+ server_type = getIntConfig(CONFIG_GAME_TYPE);
uint32 realm_zone = getIntConfig(CONFIG_REALM_ZONE);
LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realmID);