Core: Fixed remaining C6246: Local declaration of 'x' hides declaration of the same name in outer scope. from previous commit
This commit is contained in:
1 parent
f091360940
commit
358b33239a
30 files changed
+220
-226
No files matched your search
@@ -480,56 +480,44 @@ 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);
|
||||
|
||||
// Check the creature
|
||||
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;
|
||||
}
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid);
|
||||
return true;
|
||||
}
|
||||
|
||||
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, " ");
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user