Merge plus changed getposition to return a reference

This commit is contained in:
KimLS
2015-01-24 11:48:06 -08:00
19 changed files with 2173 additions and 2213 deletions
-19
View File
@@ -1013,7 +1013,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
}
if(client)
client->LogSQL(query.c_str());
query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName());
auto results = QueryDatabase(query);
@@ -1023,7 +1022,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
uint32 spawngroupid = results.LastInsertedID();
if(client)
client->LogSQL(query.c_str());
query = StringFormat("INSERT INTO spawn2 (zone, version, x, y, z, respawntime, heading, spawngroupID) "
"VALUES('%s', %u, %f, %f, %f, %i, %f, %i)",
@@ -1035,7 +1033,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
}
if(client)
client->LogSQL(query.c_str());
query = StringFormat("INSERT INTO spawnentry (spawngroupID, npcID, chance) VALUES(%i, %i, %i)",
spawngroupid, npc_type_id, 100);
@@ -1045,7 +1042,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
}
if(client)
client->LogSQL(query.c_str());
return true;
}
@@ -1061,9 +1057,6 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
}
last_insert_id = results.LastInsertedID();
if(client)
client->LogSQL(query.c_str());
uint32 respawntime = 0;
uint32 spawnid = 0;
if (respawnTime)
@@ -1084,7 +1077,6 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
spawnid = results.LastInsertedID();
if(client)
client->LogSQL(query.c_str());
query = StringFormat("INSERT INTO spawnentry (spawngroupID, npcID, chance) VALUES(%i, %i, %i)",
last_insert_id, spawn->GetNPCTypeID(), 100);
@@ -1094,7 +1086,6 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
}
if(client)
client->LogSQL(query.c_str());
return spawnid;
}
@@ -1110,7 +1101,6 @@ uint32 ZoneDatabase::UpdateNPCTypeAppearance(Client *client, NPC* spawn) {
spawn->MerchantType, spawn->GetNPCTypeID());
auto results = QueryDatabase(query);
if (!results.Success() && client)
client->LogSQL(query.c_str());
return results.Success() == true? 1: 0;
}
@@ -1141,7 +1131,6 @@ uint32 ZoneDatabase::DeleteSpawnLeaveInNPCTypeTable(const char* zone, Client *cl
return 0;
if(client)
client->LogSQL(query.c_str());
query = StringFormat("DELETE FROM spawngroup WHERE id = '%i'", spawngroupID);
results = QueryDatabase(query);
@@ -1149,7 +1138,6 @@ uint32 ZoneDatabase::DeleteSpawnLeaveInNPCTypeTable(const char* zone, Client *cl
return 0;
if(client)
client->LogSQL(query.c_str());
query = StringFormat("DELETE FROM spawnentry WHERE spawngroupID = '%i'", spawngroupID);
results = QueryDatabase(query);
@@ -1157,7 +1145,6 @@ uint32 ZoneDatabase::DeleteSpawnLeaveInNPCTypeTable(const char* zone, Client *cl
return 0;
if(client)
client->LogSQL(query.c_str());
return 1;
}
@@ -1191,7 +1178,6 @@ uint32 ZoneDatabase::DeleteSpawnRemoveFromNPCTypeTable(const char* zone, uint32
return 0;
if(client)
client->LogSQL(query.c_str());
query = StringFormat("DELETE FROM spawngroup WHERE id = '%i'", spawngroupID);
results = QueryDatabase(query);
@@ -1199,7 +1185,6 @@ uint32 ZoneDatabase::DeleteSpawnRemoveFromNPCTypeTable(const char* zone, uint32
return 0;
if(client)
client->LogSQL(query.c_str());
query = StringFormat("DELETE FROM spawnentry WHERE spawngroupID = '%i'", spawngroupID);
results = QueryDatabase(query);
@@ -1207,7 +1192,6 @@ uint32 ZoneDatabase::DeleteSpawnRemoveFromNPCTypeTable(const char* zone, uint32
return 0;
if(client)
client->LogSQL(query.c_str());
query = StringFormat("DELETE FROM npc_types WHERE id = '%i'", spawn->GetNPCTypeID());
results = QueryDatabase(query);
@@ -1215,7 +1199,6 @@ uint32 ZoneDatabase::DeleteSpawnRemoveFromNPCTypeTable(const char* zone, uint32
return 0;
if(client)
client->LogSQL(query.c_str());
return 1;
}
@@ -1232,7 +1215,6 @@ uint32 ZoneDatabase::AddSpawnFromSpawnGroup(const char* zone, uint32 zone_versi
return 0;
if(client)
client->LogSQL(query.c_str());
return 1;
}
@@ -1257,7 +1239,6 @@ uint32 ZoneDatabase::AddNPCTypes(const char* zone, uint32 zone_version, Client *
npc_type_id = results.LastInsertedID();
if(client)
client->LogSQL(query.c_str());
if(client)
client->Message(0, "%s npc_type ID %i created successfully!", numberlessName, npc_type_id);