aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpp <none@none>2010-08-23 07:51:19 +0200
committerSpp <none@none>2010-08-23 07:51:19 +0200
commit16d95d3115b27536e7a1c99e795a5f90c238eb16 (patch)
treec439bd1f062af3643285ebfe5cbb12d2916180dd /src
parentccc2a83510c2dcdcaba1c9c1f1778b8f171e0c4c (diff)
Core: Fix some warnings
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/authserver/Main.cpp2
-rw-r--r--src/server/authserver/Server/RealmSocket.cpp7
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp2
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.cpp4
-rw-r--r--src/server/game/AI/EventAI/CreatureEventAI.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp2
-rw-r--r--src/server/game/Achievements/AchievementMgr.cpp2
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.cpp10
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp2
-rw-r--r--src/server/game/Chat/Channels/Channel.cpp4
-rw-r--r--src/server/game/Chat/Chat.cpp9
-rw-r--r--src/server/game/Chat/Commands/Level0.cpp6
-rw-r--r--src/server/game/Chat/Commands/Level2.cpp10
-rw-r--r--src/server/game/Chat/Commands/Level3.cpp34
-rw-r--r--src/server/game/Combat/ThreatManager.cpp4
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp2
-rw-r--r--src/server/game/Conditions/DisableMgr.cpp2
-rw-r--r--src/server/game/DataStores/DBCStructure.h4
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp11
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp6
-rw-r--r--src/server/game/Entities/Player/Player.cpp51
-rw-r--r--src/server/shared/Database/DatabaseWorkerPool.cpp8
-rw-r--r--src/server/shared/Utilities/ProgressBar.cpp2
-rw-r--r--src/server/worldserver/worldserver.conf.dist4
30 files changed, 121 insertions, 85 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 849e1f71248..d0698b10592 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -241,7 +241,7 @@ extern int main(int argc, char **argv)
Handler.register_handler(SIGTERM, &SignalTERM);
#ifdef _WIN32
Handler.register_handler(SIGBREAK, &SignalBREAK);
- #endif /* _WIN32 */();
+ #endif /* _WIN32 */
///- Handle affinity for multiple processors and process priority on Windows
#ifdef _WIN32
diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp
index 25e672eea4d..fdb8b8b54f4 100644
--- a/src/server/authserver/Server/RealmSocket.cpp
+++ b/src/server/authserver/Server/RealmSocket.cpp
@@ -199,11 +199,12 @@ bool RealmSocket::send(const char *buf, size_t len)
if (n < 0)
return false;
- else if (n == len)
+ size_t un = size_t(n);
+ if (un == len)
return true;
// fall down
- message_block.rd_ptr((size_t)n);
+ message_block.rd_ptr(un);
}
ACE_Message_Block *mb = message_block.clone();
@@ -243,7 +244,7 @@ int RealmSocket::handle_output(ACE_HANDLE /*= ACE_INVALID_HANDLE*/)
mb->release();
return -1;
}
- else if (n == mb->length())
+ else if (size_t(n) == mb->length())
{
mb->release();
return 1;
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index c6798e70cc4..22982fe86f5 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -101,7 +101,7 @@ namespace VMAP
spawnedModelFiles.insert(entry->second.name);
}
- printf("Creating map tree...\n", map_iter->first);
+ printf("Creating map tree for map %u...\n", map_iter->first);
BIH pTree;
pTree.build(mapSpawns, BoundsTrait<ModelSpawn*>::getBounds);
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 0114eef9f27..263e966df5f 100644
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -239,7 +239,7 @@ bool TurretAI::CanAIAttack(const Unit * /*who*/) const
{
// TODO: use one function to replace it
if (!me->IsWithinCombatRange(me->getVictim(), me->m_CombatDistance)
- || m_minRange && me->IsWithinCombatRange(me->getVictim(), m_minRange))
+ || (m_minRange && me->IsWithinCombatRange(me->getVictim(), m_minRange)))
return false;
return true;
}
@@ -367,4 +367,4 @@ void VehicleAI::CheckConditions(const uint32 diff)
}
m_ConditionsTimer = VEHICLE_CONDITION_CHECK_TIME;
} else m_ConditionsTimer -= diff;
-} \ No newline at end of file
+}
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h
index 5495216b728..abb749ee28c 100644
--- a/src/server/game/AI/EventAI/CreatureEventAI.h
+++ b/src/server/game/AI/EventAI/CreatureEventAI.h
@@ -556,7 +556,7 @@ typedef UNORDERED_MAP<uint32, std::vector<CreatureEventAI_Event> > CreatureEvent
struct CreatureEventAI_Summon
{
- uint32 id2;
+ //uint32 id;
float position_x;
float position_y;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index 461442bc909..8bce6f39d66 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -356,7 +356,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, flo
if (!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER)
{
if (pUnit)
- sLog.outError("TSCR: Creature %u (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: %u) to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO);
+ sLog.outError("TSCR: Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO);
return;
}
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index faf5e1bfcfb..9cea85b6dec 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 = %u", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
+ sLog.outDebug("TSCR: EscortAI started with %u waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
CurrentWP = WaypointList.begin();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index f6bd7d0a951..c75aea7316d 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -304,7 +304,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const
me->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
- sLog.outDebug("TSCR: FollowerAI start follow %s (GUID %u)", pLeader->GetName(), m_uiLeaderGUID);
+ sLog.outDebug("TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", pLeader->GetName(), m_uiLeaderGUID);
}
Player* FollowerAI::GetLeaderForFollower()
diff --git a/src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp
index 4dd19547dda..8dbaa750701 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp
@@ -68,6 +68,7 @@ void guardAI::UpdateAI(const uint32 diff)
//Buff timer (only buff when we are alive and not in combat
if (me->isAlive() && !me->isInCombat())
+ {
if (BuffTimer <= diff)
{
//Find a spell that targets friendly and applies an aura (these are generally buffs)
@@ -86,6 +87,7 @@ void guardAI::UpdateAI(const uint32 diff)
} //Try again in 30 seconds
else BuffTimer = 30000;
} else BuffTimer -= diff;
+ }
//Return since we have no target
if (!UpdateVictim())
diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp
index 7d86c8e54a6..4ca55669245 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp
@@ -214,7 +214,7 @@ void SimpleAI::UpdateAI(const uint32 diff)
if (Spell_Timer[i] <= diff)
{
//Check if this is a percentage based
- if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && me->GetHealth()*100 / me->GetMaxHealth() > -Spell[i].First_Cast)
+ if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && me->GetHealth()*100 / me->GetMaxHealth() > uint32(-Spell[i].First_Cast))
continue;
//Check Current spell
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp
index c6a5f3bcf2b..0aa24047541 100644
--- a/src/server/game/Achievements/AchievementMgr.cpp
+++ b/src/server/game/Achievements/AchievementMgr.cpp
@@ -323,7 +323,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
return false;
return target->ToPlayer()->GetTeam() == team.team;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK:
- return Player::GetDrunkenstateByValue(source->GetDrunkValue()) >= drunk.state;
+ return Player::GetDrunkenstateByValue(source->GetDrunkValue()) >= DrunkenState(drunk.state);
case ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY:
return IsHolidayActive(HolidayIds(holiday.id));
case ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE:
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index d72aa75b952..5de82cbe949 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -46,12 +46,15 @@ ArenaTeam::ArenaTeam()
m_stats.games_week = 0;
m_stats.games_season = 0;
m_stats.rank = 0;
+ /* warning: comparison of unsigned expression >= 0 is always true
if (sWorld.getConfig(CONFIG_ARENA_START_RATING) >= 0)
m_stats.rating = sWorld.getConfig(CONFIG_ARENA_START_RATING);
else if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6)
m_stats.rating = 0;
else
m_stats.rating = 1500;
+ */
+ m_stats.rating = sWorld.getConfig(CONFIG_ARENA_START_RATING);
m_stats.wins_week = 0;
m_stats.wins_season = 0;
}
@@ -67,7 +70,8 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
if (sObjectMgr.GetArenaTeamByName(ArenaTeamName)) // arena team with this name already exist
return false;
- sLog.outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), GUID_LOPART(captainGuid));
+ uint32 captainLowGuid = GUID_LOPART(captainGuid);
+ sLog.outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), captainLowGuid);
m_CaptainGuid = captainGuid;
m_Name = ArenaTeamName;
@@ -83,14 +87,14 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
trans->PAppend("DELETE FROM arena_team_member WHERE arenateamid='%u'", m_TeamId);
trans->PAppend("INSERT INTO arena_team (arenateamid,name,captainguid,type,BackgroundColor,EmblemStyle,EmblemColor,BorderStyle,BorderColor) "
"VALUES('%u','%s','%u','%u','%u','%u','%u','%u','%u')",
- m_TeamId, ArenaTeamName.c_str(), GUID_LOPART(m_CaptainGuid), m_Type, m_BackgroundColor, m_EmblemStyle, m_EmblemColor, m_BorderStyle, m_BorderColor);
+ m_TeamId, ArenaTeamName.c_str(), captainLowGuid, m_Type, m_BackgroundColor, m_EmblemStyle, m_EmblemColor, m_BorderStyle, m_BorderColor);
trans->PAppend("INSERT INTO arena_team_stats (arenateamid, rating, games, wins, played, wins2, rank) VALUES "
"('%u', '%u', '%u', '%u', '%u', '%u', '%u')", m_TeamId, m_stats.rating, m_stats.games_week, m_stats.wins_week, m_stats.games_season, m_stats.wins_season, m_stats.rank);
CharacterDatabase.CommitTransaction(trans);
AddMember(m_CaptainGuid);
- sLog.outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain GUID: %u]", GetId(), GetType(), GetCaptain());
+ sLog.outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid);
return true;
}
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 8e8bb4d72ab..3ad148eb9e9 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -781,7 +781,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution()
if (!sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
return;
- uint64 wstime = sWorld.getWorldState(WS_ARENA_DISTRIBUTION_TIME);
+ time_t wstime = time_t(sWorld.getWorldState(WS_ARENA_DISTRIBUTION_TIME));
time_t curtime = time(NULL);
sLog.outDebug("Initializing Automatic Arena Point Distribution");
if (wstime < curtime)
@@ -790,7 +790,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution()
sLog.outDebug("Battleground: Next arena point distribution time in the past, reseting it now.");
}
else
- m_NextAutoDistributionTime = time_t(wstime);
+ m_NextAutoDistributionTime = wstime;
sLog.outDebug("Automatic Arena Point Distribution initialized.");
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index d428d323551..a3801590191 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -836,8 +836,10 @@ const uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
else if (m_Nodes[node].Owner == HORDE)
{
if (m_Nodes[node].State == POINT_ASSAULTED)
+ {
if (node <= BG_AV_NODES_STONEHEART_BUNKER)
return node+22;
+ }
else if (m_Nodes[node].State == POINT_CONTROLED)
{
if (node <= BG_AV_NODES_FROSTWOLF_HUT)
@@ -1388,7 +1390,7 @@ const char* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
case BG_AV_NODES_FROSTWOLF_HUT: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
default:
{
- sLog.outError("tried to get name for node %u%",node);
+ sLog.outError("tried to get name for node %u",node);
return "Unknown";
break;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index aa9ec2b521d..aaea9f10db2 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -763,7 +763,7 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
{
if (Source->GetTeamId() == attackers)
{
- if (Source->GetTeamId() == ALLIANCE)
+ if (Source->GetTeamId() == TEAM_ALLIANCE)
SendMessageToAll(LANG_BG_SA_ALLIANCE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 65439fada37..e191fff8bbf 100644
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -75,7 +75,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
uint64 banned_guid = atol((*iter).c_str());
if (banned_guid)
{
- sLog.outDebug("Channel(%s) loaded banned guid: %u",name.c_str(), banned_guid);
+ sLog.outDebug("Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid);
banned.insert(banned_guid);
}
}
@@ -552,7 +552,7 @@ void Channel::List(Player* player)
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
- if (plr && (player->GetSession()->GetSecurity() > SEC_PLAYER || plr->GetSession()->GetSecurity() <= gmLevelInWhoList) &&
+ if (plr && (player->GetSession()->GetSecurity() > SEC_PLAYER || plr->GetSession()->GetSecurity() <= AccountTypes(gmLevelInWhoList)) &&
plr->IsVisibleGloballyFor(player))
{
data << uint64(i->first);
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 0fa2c91befb..8b9f226d88c 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -805,7 +805,7 @@ const char *ChatHandler::GetTrinityString(int32 entry) const
bool ChatHandler::isAvailable(ChatCommand const& cmd) const
{
// check security level only for simple command (without child commands)
- return m_session->GetSecurity() >= cmd.SecurityLevel;
+ return m_session->GetSecurity() >= AccountTypes(cmd.SecurityLevel);
}
bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
@@ -847,7 +847,8 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
else
return true; // caller must report error for (target == NULL && target_account == 0)
- if (m_session->GetSecurity() < target_sec || (strong && m_session->GetSecurity() <= target_sec))
+ AccountTypes target_ac_sec = AccountTypes(target_sec);
+ if (m_session->GetSecurity() < target_ac_sec || (strong && m_session->GetSecurity() <= target_ac_sec))
{
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
SetSentErrorMessage(true);
@@ -1658,10 +1659,10 @@ valid examples:
ItemLocale const *il = sObjectMgr.GetItemLocale(linkedItem->ItemId);
bool foundName = false;
- for (uint8 i=LOCALE_koKR; i<MAX_LOCALE; ++i)
+ for (uint8 i = LOCALE_koKR; i < MAX_LOCALE; ++i)
{
int8 dbIndex = sObjectMgr.GetIndexForLocale(LocaleConstant(i));
- if (dbIndex == -1 || il == NULL || dbIndex >= il->Name.size())
+ if (dbIndex == -1 || il == NULL || uint8(dbIndex) >= il->Name.size())
// using strange database/client combinations can lead to this case
expectedName = linkedItem->Name1;
else
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
index 6e4e969e017..aef769723e3 100644
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ b/src/server/game/Chat/Commands/Level0.cpp
@@ -147,7 +147,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
// save if the player has last been saved over 20 seconds ago
uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
- if ((save_interval == 0 || save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS))
+ if (save_interval == 0 || (save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS))
player->SaveToDB();
return true;
@@ -162,7 +162,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); 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 <= AccountTypes(sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
{
if (first)
@@ -252,7 +252,7 @@ bool ChatHandler::HandleAccountAddonCommand(const char* args)
uint32 account_id = m_session->GetAccountId();
int expansion = atoi(szExp); //get int anyway (0 if error)
- if (expansion < 0 || expansion > sWorld.getConfig(CONFIG_EXPANSION))
+ if (expansion < 0 || uint8(expansion) > sWorld.getConfig(CONFIG_EXPANSION))
{
SendSysMessage(LANG_IMPROPER_VALUE);
SetSentErrorMessage(true);
diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp
index 99006a9cc0c..548271a6266 100644
--- a/src/server/game/Chat/Commands/Level2.cpp
+++ b/src/server/game/Chat/Commands/Level2.cpp
@@ -2258,7 +2258,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
if (email.empty())
email = "-";
- if (!m_session || m_session->GetSecurity() >= security)
+ if (!m_session || m_session->GetSecurity() >= AccountTypes(security))
{
last_ip = fields[3].GetCppString();
last_login = fields[4].GetCppString();
@@ -3073,7 +3073,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
return false;
}
- sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u");
+ sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point);
// set "wpguid" column to the visual waypoint
WorldDatabase.PExecute("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point);
@@ -3544,7 +3544,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
- if (event_id < 1 || event_id >=events.size())
+ if (event_id < 1 || uint32(event_id) >= events.size())
{
SendSysMessage(LANG_EVENT_NOT_EXIST);
SetSentErrorMessage(true);
@@ -3585,7 +3585,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
- if (event_id < 1 || event_id >=events.size())
+ if (event_id < 1 || uint32(event_id) >= events.size())
{
SendSysMessage(LANG_EVENT_NOT_EXIST);
SetSentErrorMessage(true);
@@ -4236,7 +4236,7 @@ bool ChatHandler::HandleNpcSetLinkCommand(const char* args)
if (!pCreature->GetDBTableGUIDLow())
{
- PSendSysMessage("Selected creature isn't in creature table", pCreature->GetGUIDLow());
+ PSendSysMessage("Selected creature %u isn't in creature table", pCreature->GetGUIDLow());
SetSentErrorMessage(true);
return false;
}
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index 118d03f0edd..0f993befb7e 100644
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -1171,7 +1171,11 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char *args)
// m_session == NULL only for console
targetAccountId = (isAccountNameGiven) ? sAccountMgr.GetId(targetAccountName) : getSelectedPlayer()->GetSession()->GetAccountId();
int32 gmRealmID = (isAccountNameGiven) ? atoi(arg3) : atoi(arg2);
- uint32 plSecurity = m_session ? sAccountMgr.GetSecurity(m_session->GetAccountId(), gmRealmID) : SEC_CONSOLE;
+ uint32 plSecurity;
+ if (m_session)
+ plSecurity = sAccountMgr.GetSecurity(m_session->GetAccountId(), gmRealmID);
+ else
+ plSecurity = SEC_CONSOLE;
// can set security level only for target with less security and to less security that we have
// This is also reject self apply in fact
@@ -2943,12 +2947,13 @@ bool ChatHandler::HandleLookupItemCommand(const char *args)
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
+ uint8 uloc_idx = uint8(loc_idx);
ItemLocale const *il = sObjectMgr.GetItemLocale(pProto->ItemId);
if (il)
{
- if (il->Name.size() > loc_idx && !il->Name[loc_idx].empty())
+ if (il->Name.size() > uloc_idx && !il->Name[uloc_idx].empty())
{
- std::string name = il->Name[loc_idx];
+ std::string name = il->Name[uloc_idx];
if (Utf8FitTo(name, wnamepart))
{
@@ -3257,12 +3262,13 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args)
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
+ uint8 uloc_idx = uint8(loc_idx);
QuestLocale const *il = sObjectMgr.GetQuestLocale(qinfo->GetQuestId());
if (il)
{
- if (il->Title.size() > loc_idx && !il->Title[loc_idx].empty())
+ if (il->Title.size() > uloc_idx && !il->Title[uloc_idx].empty())
{
- std::string title = il->Title[loc_idx];
+ std::string title = il->Title[uloc_idx];
if (Utf8FitTo(title, wnamepart))
{
@@ -3361,12 +3367,13 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
+ uint8 uloc_idx = uint8(uloc_idx);
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale (id);
if (cl)
{
- if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty ())
+ if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty ())
{
- std::string name = cl->Name[loc_idx];
+ std::string name = cl->Name[uloc_idx];
if (Utf8FitTo (name, wnamepart))
{
@@ -3431,12 +3438,13 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args)
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
+ uint8 uloc_idx = uint8(uloc_idx);
GameObjectLocale const *gl = sObjectMgr.GetGameObjectLocale(id);
if (gl)
{
- if (gl->Name.size() > loc_idx && !gl->Name[loc_idx].empty())
+ if (gl->Name.size() > uloc_idx && !gl->Name[uloc_idx].empty())
{
- std::string name = gl->Name[loc_idx];
+ std::string name = gl->Name[uloc_idx];
if (Utf8FitTo(name, wnamepart))
{
@@ -5149,7 +5157,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)
@@ -5184,7 +5192,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)
@@ -5219,7 +5227,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)
@@ -6719,7 +6727,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char *args)
return false;
int expansion = atoi(szExp); //get int anyway (0 if error)
- if (expansion < 0 || expansion > sWorld.getConfig(CONFIG_EXPANSION))
+ if (expansion < 0 || uint8(expansion) > sWorld.getConfig(CONFIG_EXPANSION))
return false;
// No SQL injection
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index 2a064a1dad1..1728ff7123e 100644
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -315,8 +315,8 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* pAttacker, Hostile
}
if (currentRef->getThreat() > 1.3f * pCurrentVictim->getThreat() ||
- currentRef->getThreat() > 1.1f * pCurrentVictim->getThreat() &&
- pAttacker->IsWithinMeleeRange(target))
+ (currentRef->getThreat() > 1.1f * pCurrentVictim->getThreat() &&
+ pAttacker->IsWithinMeleeRange(target)))
{ //implement 110% threat rule for targets in melee range
found = true; //and 130% rule for targets in ranged distances
break; //for selecting alive targets
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index e165ec70848..b63766bde6d 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -62,7 +62,7 @@ bool Condition::Meets(Player * player, Unit* targetOverride)
case CONDITION_REPUTATION_RANK:
{
FactionEntry const* faction = sFactionStore.LookupEntry(mConditionValue1);
- condMeets = faction && uint32(player->GetReputationMgr().GetRank(faction)) >= int32(mConditionValue2);
+ condMeets = faction && uint32(player->GetReputationMgr().GetRank(faction)) >= mConditionValue2;
break;
}
case CONDITION_ACHIEVEMENT:
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp
index 9de97269f68..21119b3715b 100644
--- a/src/server/game/Conditions/DisableMgr.cpp
+++ b/src/server/game/Conditions/DisableMgr.cpp
@@ -116,7 +116,7 @@ void DisableMgr::LoadDisables()
break;
case MAP_BATTLEGROUND:
case MAP_ARENA:
- sLog.outErrorDb("Battleground map specified to be disabled in map case, skipped.", entry);
+ sLog.outErrorDb("Battleground map %u specified to be disabled in map case, skipped.", entry);
continue;
}
if (isFlagInvalid)
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index 5fbe10b12e9..1d6a68c2c2d 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -43,8 +43,8 @@
struct AchievementEntry
{
uint32 ID; // 0
- uint32 factionFlag; // 1 -1=all, 0=horde, 1=alliance
- uint32 mapID; // 2 -1=none
+ int32 factionFlag; // 1 -1=all, 0=horde, 1=alliance
+ int32 mapID; // 2 -1=none
//uint32 parentAchievement; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin)
char *name[16]; // 4-19
//uint32 name_flags; // 20
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 0b780b839c1..9d58f56d9ab 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -1041,11 +1041,13 @@ void GameObject::Use(Unit* user)
return;
if (!ChairListSlots.size()) // this is called once at first chair use to make list of available slots
+ {
if (info->chair.slots > 0) // sometimes chairs in DB have error in fields and we dont know number of slots
for (uint32 i = 0; i < info->chair.slots; ++i)
ChairListSlots[i] = 0; // Last user of current slot set to 0 (none sit here yet)
else
ChairListSlots[0] = 0; // error in DB, make one default slot
+ }
Player* player = (Player*)user;
@@ -1071,6 +1073,7 @@ void GameObject::Use(Unit* user)
float y_i = GetPositionY() + relativeDistance * sin(orthogonalOrientation);
if (itr->second)
+ {
if (Player* ChairUser = sObjectMgr.GetPlayer(itr->second))
if (ChairUser->IsSitState() && ChairUser->getStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->getStandState() != UNIT_STAND_STATE_SIT check is required.
@@ -1078,6 +1081,7 @@ void GameObject::Use(Unit* user)
itr->second = 0; // This seat is unoccupied.
else
itr->second = 0; // The seat may of had an occupant, but they're offline.
+ }
found_free_slot = true;
@@ -1703,9 +1707,12 @@ void GameObject::EventInform(uint32 eventId)
const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
{
if (loc_idx >= 0)
+ {
+ uint8 uloc_idx = uint8(loc_idx);
if (GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry()))
- if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
- return cl->Name[loc_idx].c_str();
+ if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty())
+ return cl->Name[uloc_idx].c_str();
+ }
return GetName();
}
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 817aa2a8842..ee0f422a83d 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -510,7 +510,7 @@ void Pet::Update(uint32 diff)
{
// unsummon pet that lost owner
Player* owner = GetOwner();
- if (!owner || (!IsWithinDistInMap(owner, GetMap()->GetVisibilityDistance()) && !isPossessed()) || isControlled() && !owner->GetPetGUID())
+ if (!owner || (!IsWithinDistInMap(owner, GetMap()->GetVisibilityDistance()) && !isPossessed()) || (isControlled() && !owner->GetPetGUID()))
//if (!owner || (!IsWithinDistInMap(owner, GetMap()->GetVisibilityDistance()) && (owner->GetCharmGUID() && (owner->GetCharmGUID() != GetGUID()))) || (isControlled() && !owner->GetPetGUID()))
{
Remove(PET_SAVE_NOT_IN_SLOT, true);
@@ -521,7 +521,7 @@ void Pet::Update(uint32 diff)
{
if (owner->GetPetGUID() != GetGUID())
{
- sLog.outError("Pet %u is not pet of owner %u, removed", GetEntry(), m_owner->GetName());
+ sLog.outError("Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName());
Remove(getPetType() == HUNTER_PET?PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT);
return;
}
@@ -529,7 +529,7 @@ void Pet::Update(uint32 diff)
if (m_duration > 0)
{
- if (m_duration > diff)
+ if (uint32(m_duration) > diff)
m_duration -= diff;
else
{
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 0cd6eb88d60..d683e6184e5 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -600,7 +600,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_ChampioningFaction = 0;
- for (int i = 0; i < MAX_POWERS; ++i)
+ for (uint8 i = 0; i < MAX_POWERS; ++i)
m_powerFraction[i] = 0;
m_globalCooldowns.clear();
@@ -880,7 +880,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
count = 2;
break;
}
- if (iProto->Stackable < count)
+ if (uint32(iProto->Stackable) < count)
count = iProto->Stackable;
}
StoreNewItemInBestSlots(item_id, count);
@@ -1041,7 +1041,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
return MINUTE*IN_MILLISECONDS;
case BREATH_TIMER:
{
- if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_DISABLE_BREATHING))
+ if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld.getConfig(CONFIG_DISABLE_BREATHING)))
return DISABLED_MIRROR_TIMER;
int32 UnderWaterTime = 3*MINUTE*IN_MILLISECONDS;
AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING);
@@ -2481,7 +2481,11 @@ void Player::SetGameMaster(bool on)
{
// restore phase
AuraEffectList const& phases = GetAuraEffectsByType(SPELL_AURA_PHASE);
- SetPhaseMask(!phases.empty() ? phases.front()->GetMiscValue() : PHASEMASK_NORMAL,false);
+ if (!phases.empty())
+ SetPhaseMask(phases.front()->GetMiscValue(), false);
+ else
+ SetPhaseMask(PHASEMASK_NORMAL, false);
+
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
setFactionForRace(getRace());
@@ -4593,7 +4597,7 @@ void Player::DeleteOldCharacters(uint32 keepDays)
QueryResult_AutoPtr resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '" UI64FMTD "'", uint64(time(NULL) - time_t(keepDays * DAY)));
if (resultChars)
{
- sLog.outString("Player::DeleteOldChars: Found %u character(s) to delete",resultChars->GetRowCount());
+ sLog.outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete",resultChars->GetRowCount());
do
{
Field *charFields = resultChars->Fetch();
@@ -6671,12 +6675,12 @@ void Player::RewardReputation(Quest const *pQuest)
void Player::UpdateHonorFields()
{
/// called when rewarding honor and at each save
- uint64 now = time(NULL);
- uint64 today = uint64(time(NULL) / DAY) * DAY;
+ time_t now = time_t(time(NULL));
+ time_t today = time_t(time(NULL) / DAY) * DAY;
if (m_lastHonorUpdateTime < today)
{
- uint64 yesterday = today - DAY;
+ time_t yesterday = today - DAY;
uint16 kills_today = PAIR32_LOPART(GetUInt32Value(PLAYER_FIELD_KILLS));
@@ -10967,7 +10971,12 @@ uint8 Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, boo
return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE;
// if swap ignore item (equipped also)
- if (uint8 res2 = CanEquipUniqueItem(pItem, swap ? eslot : NULL_SLOT))
+ uint8 res2 = 0;
+ if (swap)
+ res2 = CanEquipUniqueItem(pItem, eslot);
+ else
+ res2 = CanEquipUniqueItem(pItem, NULL_SLOT);
+ if (res2)
return res2;
// check unique-equipped special item classes
@@ -12620,7 +12629,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
if (IsBagPos(src))
{
Bag* bag = (Bag*)pSrcItem;
- for (int i=0; i < bag->GetBagSize(); ++i)
+ for (uint32 i = 0; i < bag->GetBagSize(); ++i)
{
if (Item *bagItem = bag->GetItemByPos(i))
{
@@ -12637,7 +12646,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
if (!released && IsBagPos(dst) && pDstItem)
{
Bag* bag = (Bag*)pDstItem;
- for (int i=0; i < bag->GetBagSize(); ++i)
+ for (uint32 i = 0; i < bag->GetBagSize(); ++i)
{
if (Item *bagItem = bag->GetItemByPos(i))
{
@@ -13942,11 +13951,12 @@ void Player::SendPreparedQuest(uint64 guid)
int loc_idx = GetSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
+ uint8 uloc_idx = uint8(loc_idx);
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textid);
if (nl)
{
- if (nl->Text_0[0].size() > loc_idx && !nl->Text_0[0][loc_idx].empty())
- title = nl->Text_0[0][loc_idx];
+ if (nl->Text_0[0].size() > uloc_idx && !nl->Text_0[0][uloc_idx].empty())
+ title = nl->Text_0[0][uloc_idx];
}
}
}
@@ -13957,11 +13967,12 @@ void Player::SendPreparedQuest(uint64 guid)
int loc_idx = GetSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
+ uint8 uloc_idx = uint8(loc_idx);
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textid);
if (nl)
{
- if (nl->Text_1[0].size() > loc_idx && !nl->Text_1[0][loc_idx].empty())
- title = nl->Text_1[0][loc_idx];
+ if (nl->Text_1[0].size() > uloc_idx && !nl->Text_1[0][uloc_idx].empty())
+ title = nl->Text_1[0][uloc_idx];
}
}
}
@@ -18172,9 +18183,9 @@ void Player::_SaveStats(SQLTransaction& trans)
"blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower) VALUES ("
<< GetGUIDLow() << ", "
<< GetMaxHealth() << ", ";
- for (int i = 0; i < MAX_POWERS; ++i)
+ for (uint8 i = 0; i < MAX_POWERS; ++i)
ss << GetMaxPower(Powers(i)) << ", ";
- for (int i = 0; i < MAX_STATS; ++i)
+ for (uint8 i = 0; i < MAX_STATS; ++i)
ss << GetStat(Stats(i)) << ", ";
// armor + school resistances
for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
@@ -19773,7 +19784,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
}
}
- int32 price = crItem->IsGoldRequired(pProto) ? pProto->BuyPrice * count : 0;
+ uint32 price = crItem->IsGoldRequired(pProto) ? pProto->BuyPrice * count : 0;
// reputation discount
if (price)
@@ -21734,7 +21745,7 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
// level difference must be small enough to get RaF bonus, UNLESS we are lower level
if (pGroupGuy->getLevel() < getLevel())
- if ((getLevel() - pGroupGuy->getLevel()) > sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE))
+ if (uint8(getLevel() - pGroupGuy->getLevel()) > sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE))
continue;
}
@@ -22797,7 +22808,7 @@ void Player::_LoadSkills(QueryResult_AutoPtr result)
if (count >= PLAYER_MAX_SKILLS) // client limit
{
- sLog.outError("Character %u has more than %u skills.", PLAYER_MAX_SKILLS);
+ sLog.outError("Character %u has more than %u skills.", GetGUIDLow(), PLAYER_MAX_SKILLS);
break;
}
} while (result->NextRow());
diff --git a/src/server/shared/Database/DatabaseWorkerPool.cpp b/src/server/shared/Database/DatabaseWorkerPool.cpp
index 019435eb417..b3ad3d6e676 100644
--- a/src/server/shared/Database/DatabaseWorkerPool.cpp
+++ b/src/server/shared/Database/DatabaseWorkerPool.cpp
@@ -137,7 +137,7 @@ void DatabaseWorkerPool::PExecute(const char* sql, ...)
va_list ap;
char szQuery[MAX_QUERY_LEN];
va_start(ap, sql);
- int res = vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap);
+ vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap);
va_end(ap);
Execute(szQuery);
@@ -157,7 +157,7 @@ void DatabaseWorkerPool::DirectPExecute(const char* sql, ...)
va_list ap;
char szQuery[MAX_QUERY_LEN];
va_start(ap, sql);
- int res = vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap);
+ vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap);
va_end(ap);
return DirectExecute(szQuery);
@@ -176,7 +176,7 @@ QueryResult_AutoPtr DatabaseWorkerPool::PQuery(const char* sql, ...)
va_list ap;
char szQuery[MAX_QUERY_LEN];
va_start(ap, sql);
- int res = vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap);
+ vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap);
va_end(ap);
return Query(szQuery);
@@ -216,7 +216,7 @@ ACE_Future<QueryResult_AutoPtr> DatabaseWorkerPool::AsyncPQuery(const char* sql,
va_list ap;
char szQuery[MAX_QUERY_LEN];
va_start(ap, sql);
- int res = vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap);
+ vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap);
va_end(ap);
return AsyncQuery(szQuery);
diff --git a/src/server/shared/Utilities/ProgressBar.cpp b/src/server/shared/Utilities/ProgressBar.cpp
index 1828eca515e..d9ef23b6133 100644
--- a/src/server/shared/Utilities/ProgressBar.cpp
+++ b/src/server/shared/Utilities/ProgressBar.cpp
@@ -46,7 +46,7 @@ barGoLink::barGoLink( uint64 row_count )
#else
printf( "[" );
#endif
- for (int i = 0; i < indic_len; i++ ) printf( empty );
+ for (uint64 i = 0; i < indic_len; ++i) printf( empty );
#ifdef _WIN32
printf( "\x3D 0%%\r\x3D" );
#else
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 6b1390ef475..79ce98ce4e9 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -1795,11 +1795,11 @@ Battleground.Random.ResetHour = 6
#
# Arena.ArenaStartRating
# Start arena team command rating
-# Default: 1500
+# Default: 0
#
# Arena.StartPersonalRating
# Start personal rating on entry in team
-# Default: 1500
+# Default: 0
#
###############################################################################