Core/DBLayer: Change some regular statements to prepared statements.

Patch by [email protected].
Fixes issue #3774

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-09-18 19:21:03 -07:00
parent 52282986e1
commit 1e127eef73
3 changed files with 12 additions and 2 deletions
+8 -2
View File
@@ -1216,16 +1216,22 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid)
if (!linkedGuid) // we're removing the linking
{
mCreatureLinkedRespawnMap.erase(guid);
WorldDatabase.PExecute("DELETE FROM creature_linked_respawn WHERE guid = '%u'",guid);
PreparedStatement *stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CRELINKED_RESPAWN);
stmt->setUInt32(0, guid);
WorldDatabase.Execute(stmt);
return true;
}
if (CheckCreatureLinkedRespawn(guid,linkedGuid)) // we add/change linking
{
mCreatureLinkedRespawnMap[guid] = linkedGuid;
WorldDatabase.PExecute("REPLACE INTO creature_linked_respawn (guid,linkedGuid) VALUES ('%u','%u')",guid,linkedGuid);
PreparedStatement *stmt = WorldDatabase.GetPreparedStatement(WORLD_REP_CRELINKED_RESPAWN);
stmt->setUInt32(0, guid);
stmt->setUInt64(1, linkedGuid);
WorldDatabase.Execute(stmt);
return true;
}
return false;
}