diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 828d258de..f37b98ac0 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1068,7 +1068,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) // updated in DB WorldDatabase.BeginTransaction(); - WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); + WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid=%u", m_DBTableGuid); std::ostringstream ss; ss << "INSERT INTO creature VALUES (" @@ -1359,12 +1359,12 @@ void Creature::DeleteFromDB() sObjectMgr.DeleteCreatureData(m_DBTableGuid); WorldDatabase.BeginTransaction(); - WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); - WorldDatabase.PExecuteLog("DELETE FROM creature_addon WHERE guid = '%u'", m_DBTableGuid); - WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id = '%u'", m_DBTableGuid); - WorldDatabase.PExecuteLog("DELETE FROM game_event_creature WHERE guid = '%u'", m_DBTableGuid); - WorldDatabase.PExecuteLog("DELETE FROM game_event_creature_data WHERE guid = '%u'", m_DBTableGuid); - WorldDatabase.PExecuteLog("DELETE FROM creature_battleground WHERE guid = '%u'", m_DBTableGuid); + WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid=%u", m_DBTableGuid); + WorldDatabase.PExecuteLog("DELETE FROM creature_addon WHERE guid=%u", m_DBTableGuid); + WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id=%u", m_DBTableGuid); + WorldDatabase.PExecuteLog("DELETE FROM game_event_creature WHERE guid=%u", m_DBTableGuid); + WorldDatabase.PExecuteLog("DELETE FROM game_event_creature_data WHERE guid=%u", m_DBTableGuid); + WorldDatabase.PExecuteLog("DELETE FROM creature_battleground WHERE guid=%u", m_DBTableGuid); WorldDatabase.CommitTransaction(); } diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index e514ddd9e..e9d316b91 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -1695,7 +1695,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(char* args) sWaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0); // update movement type - WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid); + WorldDatabase.PExecuteLog("UPDATE creature SET MovementType=%u WHERE guid=%u", WAYPOINT_MOTION_TYPE,lowguid); if (pCreature) { pCreature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); @@ -2965,7 +2965,7 @@ bool ChatHandler::HandleWpAddCommand(char* args) target->SaveToDB(); } else - WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid); + WorldDatabase.PExecuteLog("UPDATE creature SET MovementType=%u WHERE guid=%u", WAYPOINT_MOTION_TYPE,lowguid); PSendSysMessage(LANG_WAYPOINT_ADDED, point, lowguid); @@ -3574,7 +3574,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) { PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, wpGuid); hasError = true; - WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", wpGuid); + WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid=%u", wpGuid); } else { @@ -3628,7 +3628,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) wpCreature->SetVisibility(VISIBILITY_OFF); DEBUG_LOG("DEBUG: UPDATE creature_movement SET wpguid = '%u", wpCreature->GetGUIDLow()); // set "wpguid" column to the visual waypoint - WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), lowguid, point); + WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid=%u WHERE id=%u and point=%u", wpCreature->GetGUIDLow(), lowguid, point); wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); @@ -3754,7 +3754,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) if (show == "off") { - QueryResult *result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE id = '%u'", VISUAL_WAYPOINT); + QueryResult *result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE id=%u", VISUAL_WAYPOINT); if (!result) { SendSysMessage(LANG_WAYPOINT_VP_NOTFOUND); @@ -3771,7 +3771,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) { PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, wpGuid); hasError = true; - WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", wpGuid); + WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid=%u", wpGuid); } else { @@ -3780,7 +3780,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) } }while(result->NextRow()); // set "wpguid" column to "empty" - no visual waypoint spawned - WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '0' WHERE wpguid <> '0'"); + WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid=0 WHERE wpguid <> 0"); if (hasError) { diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp index 61ea4f01e..a3caf34e5 100644 --- a/src/game/WaypointManager.cpp +++ b/src/game/WaypointManager.cpp @@ -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()) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9a343e235..2e0dbecf5 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11080" + #define REVISION_NR "11081" #endif // __REVISION_NR_H__