aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.h2
-rwxr-xr-xsrc/server/game/Chat/Channels/Channel.cpp1
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp2
-rw-r--r--src/server/scripts/Commands/cs_account.cpp8
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp14
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp20
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp2
-rw-r--r--src/server/scripts/Kalimdor/the_barrens.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp6
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp2
12 files changed, 27 insertions, 37 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index b9a92f0cb44..ce7fa8d81a4 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -520,7 +520,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId
if (selectionWeights)
{
- if (!selectionWeights->size())
+ if (selectionWeights->empty())
return NULL;
uint32 Weight = 0;
uint32 selectedWeight = 0;
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h
index 0b0c0ceb2a6..b453ba59170 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.h
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.h
@@ -122,7 +122,7 @@ class BattlegroundMgr
bool isTesting() const { return m_Testing; }
static bool IsArenaType(BattlegroundTypeId bgTypeId);
- static bool IsBattlegroundType(BattlegroundTypeId bgTypeId) { return !BattlegroundMgr::IsArenaType(bgTypeId); }
+ static bool IsBattlegroundType(BattlegroundTypeId bgTypeId) { return !IsArenaType(bgTypeId); }
static BattlegroundQueueTypeId BGQueueTypeId(BattlegroundTypeId bgTypeId, uint8 arenaType);
static BattlegroundTypeId BGTemplateId(BattlegroundQueueTypeId bgQueueTypeId);
static uint8 BGArenaType(BattlegroundQueueTypeId bgQueueTypeId);
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index c56b975acb9..d39018e69a4 100755
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -377,7 +377,6 @@ void Channel::UnBan(uint64 good, const char *badname)
void Channel::Password(uint64 p, const char *pass)
{
- std::string plName;
uint32 sec = 0;
Player *plr = ObjectAccessor::FindPlayer(p);
if (plr)
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 4154b297d9e..c9752c6377b 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -743,7 +743,7 @@ LfgProposal* LFGMgr::FindNewGroups(LfgGuidList& check, LfgGuidList& all)
return NULL;
// Try to match with queued groups
- while (!pProposal && all.size() > 0)
+ while (!pProposal && !all.empty())
{
check.push_back(all.front());
all.pop_front();
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index c63e47fbc50..17bc0daec5b 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -282,11 +282,7 @@ public:
return false;
}
- std::string password_old = old_pass;
- std::string password_new = new_pass;
- std::string password_new_c = new_pass_c;
-
- if (!sAccountMgr->CheckPassword(handler->GetSession()->GetAccountId(), password_old))
+ if (!sAccountMgr->CheckPassword(handler->GetSession()->GetAccountId(), std::string(old_pass)))
{
handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD);
handler->SetSentErrorMessage(true);
@@ -300,7 +296,7 @@ public:
return false;
}
- AccountOpResult result = sAccountMgr->ChangePassword(handler->GetSession()->GetAccountId(), password_new);
+ AccountOpResult result = sAccountMgr->ChangePassword(handler->GetSession()->GetAccountId(), std::string(new_pass));
switch(result)
{
case AOR_OK:
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index a3e862c0812..ec96aa0ee65 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1012,20 +1012,19 @@ public:
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, Opcode, GUID_LOPART(guid), target->GetValuesCount());
return false;
}
- uint32 iValue;
- float fValue;
+
bool isint32 = true;
if (pz)
isint32 = (bool)atoi(pz);
if (isint32)
{
- iValue = (uint32)atoi(py);
+ uint32 iValue = (uint32)atoi(py);
target->SetUInt32Value(Opcode , iValue);
handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode, iValue);
}
else
{
- fValue = (float)atof(py);
+ float fValue = (float)atof(py);
target->SetFloatValue(Opcode , fValue);
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue);
}
@@ -1060,20 +1059,19 @@ public:
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, Opcode, GUID_LOPART(guid), target->GetValuesCount());
return false;
}
- uint32 iValue;
- float fValue;
+
bool isint32 = true;
if (pz)
isint32 = (bool)atoi(pz);
if (isint32)
{
- iValue = target->GetUInt32Value(Opcode);
+ uint32 iValue = target->GetUInt32Value(Opcode);
handler->PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), Opcode, iValue);
}
else
{
- fValue = target->GetFloatValue(Opcode);
+ float fValue = target->GetFloatValue(Opcode);
handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue);
}
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index 4dbc47de4ce..184e24c1488 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -199,7 +199,7 @@ public:
}
static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/)
{
- uint32 guidlow = 0;
+
Creature* target = handler->getSelectedCreature();
if (!target)
@@ -208,11 +208,13 @@ public:
return true;
}
+ uint32 guidlow = target->GetDBTableGUIDLow();
+
if (target->GetCreatureAddon())
{
if (target->GetCreatureAddon()->path_id != 0)
{
- WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", target->GetGUIDLow());
+ WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", guidlow);
target->UpdateWaypointID(0);
WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", IDLE_MOTION_TYPE, guidlow);
target->LoadPath(0);
@@ -373,8 +375,6 @@ public:
return true;
}
- float coord;
-
if (arg_str_2 == "setid")
{
uint32 newid = atoi(arg_3);
@@ -394,33 +394,29 @@ public:
if (arg_str_2 == "posx")
{
- coord = (float)(atof(arg_3));
WorldDatabase.PExecute("UPDATE waypoint_scripts SET x='%f' WHERE guid='%u'",
- coord, id);
+ (float)(atof(arg_3)), id);
handler->PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff %u|r|cff00ff00 position_x updated.|r", id);
return true;
}
else if (arg_str_2 == "posy")
{
- coord = (float)(atof(arg_3));
WorldDatabase.PExecute("UPDATE waypoint_scripts SET y='%f' WHERE guid='%u'",
- coord, id);
+ (float)(atof(arg_3)), id);
handler->PSendSysMessage("|cff00ff00Waypoint script: %u position_y updated.|r", id);
return true;
}
else if (arg_str_2 == "posz")
{
- coord = (float)(atof(arg_3));
WorldDatabase.PExecute("UPDATE waypoint_scripts SET z='%f' WHERE guid='%u'",
- coord, id);
+ (float)(atof(arg_3)), id);
handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 position_z updated.|r", id);
return true;
}
else if (arg_str_2 == "orientation")
{
- coord = (float)(atof(arg_3));
WorldDatabase.PExecute("UPDATE waypoint_scripts SET o='%f' WHERE guid='%u'",
- coord, id);
+ (float)(atof(arg_3)), id);
handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 orientation updated.|r", id);
return true;
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
index dfa28111935..c8a38164126 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -189,7 +189,7 @@ public:
std::vector<Unit*> targets;
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
- if (!t_list.size())
+ if (t_list.empty())
return;
//store the threat list in a different container
diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp
index f341e47c5e8..4fb76c9c610 100644
--- a/src/server/scripts/Kalimdor/the_barrens.cpp
+++ b/src/server/scripts/Kalimdor/the_barrens.cpp
@@ -490,7 +490,7 @@ public:
if (Wave_Timer <= diff)
{
- if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill)
+ if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill)
{
DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, me);
Creature* creature = Unit::GetCreature((*me), AffrayChallenger[Wave]);
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
index f8aaf0ee363..c34528530bd 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
@@ -204,12 +204,11 @@ class mob_corrupted_soul_fragment : public CreatureScript
if (type != TARGETED_MOTION_TYPE)
return;
- uint64 BronjahmGUID = 0;
if (instance)
{
if (TempSummon* summ = me->ToTempSummon())
{
- BronjahmGUID = instance->GetData64(DATA_BRONJAHM);
+ uint64 BronjahmGUID = instance->GetData64(DATA_BRONJAHM);
if (GUID_LOPART(BronjahmGUID) != id)
return;
diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp
index e7dffae5c9d..748de08f5e0 100644
--- a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp
@@ -78,6 +78,7 @@ class instance_ulduar : public InstanceMapScript
// Miscellaneous
uint32 TeamInInstance;
uint32 HodirRareCacheData;
+ uint32 ColossusData;
uint8 elderCount;
bool conSpeedAtory;
@@ -117,6 +118,7 @@ class instance_ulduar : public InstanceMapScript
ArchivumDoorGUID = 0;
TeamInInstance = 0;
HodirRareCacheData = 0;
+ ColossusData = 0;
elderCount = 0;
conSpeedAtory = false;
@@ -473,7 +475,7 @@ class instance_ulduar : public InstanceMapScript
switch (type)
{
case DATA_COLOSSUS:
- Encounter[DATA_COLOSSUS] = data;
+ ColossusData = data;
if (data == 2)
{
if (Creature* Leviathan = instance->GetCreature(LeviathanGUID))
@@ -589,7 +591,7 @@ class instance_ulduar : public InstanceMapScript
switch (type)
{
case DATA_COLOSSUS:
- return Encounter[type];
+ return ColossusData;
case DATA_HODIR_RARE_CACHE:
return HodirRareCacheData;
default:
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
index d827533610d..d4f9803b800 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
@@ -132,7 +132,7 @@ class boss_void_reaver : public CreatureScript
target = NULL;
}
- if (target_list.size())
+ if (!target_list.empty())
target = *(target_list.begin()+rand()%target_list.size());
else
target = me->getVictim();