aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-11-23 19:17:33 +0100
committerShauren <shauren.trinity@gmail.com>2011-11-23 19:17:33 +0100
commit358b33239aea4e7b5b81f829e0b0079e3ab03830 (patch)
tree1d18bf9c3269a826dc82dc2542a050068aa3ac88 /src/server/scripts/Commands
parentf091360940322c5b674c93e80b59af66881f9953 (diff)
Core: Fixed remaining C6246: Local declaration of 'x' hides declaration of the same name in outer scope. from previous commit
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp6
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp16
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp66
3 files changed, 38 insertions, 50 deletions
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 31d8cd3c8f2..b1a3f55314c 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -128,13 +128,13 @@ public:
// remove all quest entries for 'entry' from quest log
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
{
- uint32 quest = player->GetQuestSlotQuestId(slot);
- if (quest == entry)
+ uint32 logQuest = player->GetQuestSlotQuestId(slot);
+ if (logQuest == entry)
{
player->SetQuestSlot(slot, 0);
// we ignore unequippable quest items in this case, its' still be equipped
- player->TakeQuestSourceItem(quest, false);
+ player->TakeQuestSourceItem(logQuest, false);
}
}
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index 8bfa010463a..ef4ddf17476 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -126,7 +126,7 @@ public:
return false;
if (strcmp(teleStr, "$home") == 0) // References target's homebind
- {
+ {
if (target)
target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation());
else
@@ -140,11 +140,11 @@ public:
float posX = fieldsDB[2].GetFloat();
float posY = fieldsDB[3].GetFloat();
float posZ = fieldsDB[4].GetFloat();
-
+
Player::SavePositionInDB(mapId, posX, posY, posZ, 0, zoneId, target_guid);
}
}
-
+
return true;
}
@@ -210,8 +210,8 @@ public:
if (!*args)
return false;
- Player* player = handler->getSelectedPlayer();
- if (!player)
+ Player* target = handler->getSelectedPlayer();
+ if (!target)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
@@ -219,7 +219,7 @@ public:
}
// check online security
- if (handler->HasLowerSecurity(player, 0))
+ if (handler->HasLowerSecurity(target, 0))
return false;
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
@@ -239,9 +239,9 @@ public:
return false;
}
- std::string nameLink = handler->GetNameLink(player);
+ std::string nameLink = handler->GetNameLink(target);
- Group* grp = player->GetGroup();
+ Group* grp = target->GetGroup();
if (!grp)
{
handler->PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str());
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index f754a32fbfc..ebeb7b8f4f4 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -480,55 +480,43 @@ public:
}
// The visual waypoint
- Creature* wpCreature = NULL;
wpGuid = target->GetGUIDLow();
- // Did the user select a visual spawnpoint?
- if (wpGuid)
- wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
- // attempt check creature existence by DB data
- else
- {
- handler->PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, wpGuid);
- return false;
- }
// User did select a visual waypoint?
+
// Check the creature
- if (wpCreature->GetEntry() == VISUAL_WAYPOINT)
- {
- QueryResult result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid);
+ QueryResult result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid);
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow());
+ // Select waypoint number from database
+ // Since we compare float values, we have to deal with
+ // some difficulties.
+ // Here we search for all waypoints that only differ in one from 1 thousand
+ // (0.001) - There is no other way to compare C++ floats with mySQL floats
+ // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html
+ const char* maxDIFF = "0.01";
+ result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE (abs(position_x - %f) <= %s) and (abs(position_y - %f) <= %s) and (abs(position_z - %f) <= %s)",
+ target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF);
if (!result)
{
- handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow());
- // Select waypoint number from database
- // Since we compare float values, we have to deal with
- // some difficulties.
- // Here we search for all waypoints that only differ in one from 1 thousand
- // (0.001) - There is no other way to compare C++ floats with mySQL floats
- // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html
- const char* maxDIFF = "0.01";
- result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE (abs(position_x - %f) <= %s) and (abs(position_y - %f) <= %s) and (abs(position_z - %f) <= %s)",
- wpCreature->GetPositionX(), maxDIFF, wpCreature->GetPositionY(), maxDIFF, wpCreature->GetPositionZ(), maxDIFF);
- if (!result)
- {
- handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid);
- return true;
- }
- }
-
- do
- {
- Field* fields = result->Fetch();
- pathid = fields[0].GetUInt32();
- point = fields[1].GetUInt32();
+ handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid);
+ return true;
}
- while (result->NextRow());
+ }
- // We have the waypoint number and the GUID of the "master npc"
- // Text is enclosed in "<>", all other arguments not
- arg_str = strtok((char*)NULL, " ");
+ do
+ {
+ Field* fields = result->Fetch();
+ pathid = fields[0].GetUInt32();
+ point = fields[1].GetUInt32();
}
+ while (result->NextRow());
+
+ // We have the waypoint number and the GUID of the "master npc"
+ // Text is enclosed in "<>", all other arguments not
+ arg_str = strtok((char*)NULL, " ");
// Check for argument
if (show != "del" && show != "move" && arg_str == NULL)