mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[11081] Beautify some SQL log queries and remove not needed enclose character
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
117991076d
commit
3251f39684
4 changed files with 21 additions and 21 deletions
|
|
@ -453,7 +453,7 @@ void WaypointManager::AddLastNode(uint32 id, float x, float y, float z, float o,
|
|||
void WaypointManager::AddAfterNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid)
|
||||
{
|
||||
for(uint32 i = GetLastPoint(id, 0); i > point; i--)
|
||||
WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point+1 WHERE id='%u' AND point='%u'", id, i);
|
||||
WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point+1 WHERE id=%u AND point=%u", id, i);
|
||||
|
||||
_addNode(id, point + 1, x, y, z, o, delay, wpGuid);
|
||||
}
|
||||
|
|
@ -463,7 +463,7 @@ void WaypointManager::_addNode(uint32 id, uint32 point, float x, float y, float
|
|||
{
|
||||
if(point == 0) return; // counted from 1 in the DB
|
||||
WorldDatabase.PExecuteLog("INSERT INTO creature_movement (id,point,position_x,position_y,position_z,orientation,wpguid,waittime) "
|
||||
"VALUES ('%u','%u','%f', '%f', '%f', '%f', '%u', '%u')",
|
||||
"VALUES (%u,%u, %f,%f,%f,%f, %u,%u)",
|
||||
id, point, x, y, z, o, wpGuid, delay);
|
||||
WaypointPathMap::iterator itr = m_pathMap.find(id);
|
||||
if(itr == m_pathMap.end())
|
||||
|
|
@ -489,8 +489,8 @@ uint32 WaypointManager::GetLastPoint(uint32 id, uint32 default_notfound)
|
|||
void WaypointManager::DeleteNode(uint32 id, uint32 point)
|
||||
{
|
||||
if(point == 0) return; // counted from 1 in the DB
|
||||
WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id='%u' AND point='%u'", id, point);
|
||||
WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point-1 WHERE id='%u' AND point>'%u'", id, point);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id=%u AND point=%u", id, point);
|
||||
WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point-1 WHERE id=%u AND point>%u", id, point);
|
||||
WaypointPathMap::iterator itr = m_pathMap.find(id);
|
||||
if(itr != m_pathMap.end() && point <= itr->second.size())
|
||||
itr->second.erase(itr->second.begin() + (point-1));
|
||||
|
|
@ -498,7 +498,7 @@ void WaypointManager::DeleteNode(uint32 id, uint32 point)
|
|||
|
||||
void WaypointManager::DeletePath(uint32 id)
|
||||
{
|
||||
WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id='%u'", id);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id=%u", id);
|
||||
WaypointPathMap::iterator itr = m_pathMap.find(id);
|
||||
if(itr != m_pathMap.end())
|
||||
_clearPath(itr->second);
|
||||
|
|
@ -511,7 +511,7 @@ void WaypointManager::DeletePath(uint32 id)
|
|||
void WaypointManager::SetNodePosition(uint32 id, uint32 point, float x, float y, float z)
|
||||
{
|
||||
if(point == 0) return; // counted from 1 in the DB
|
||||
WorldDatabase.PExecuteLog("UPDATE creature_movement SET position_x = '%f',position_y = '%f',position_z = '%f' where id = '%u' AND point='%u'", x, y, z, id, point);
|
||||
WorldDatabase.PExecuteLog("UPDATE creature_movement SET position_x=%f, position_y=%f, position_z=%f WHERE id=%u AND point=%u", x, y, z, id, point);
|
||||
WaypointPathMap::iterator itr = m_pathMap.find(id);
|
||||
if(itr != m_pathMap.end() && point <= itr->second.size())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue