Fixed an issue that has surfaced with new code behaving how it should, breaking old code. Naked corpses were not despawning on their decay timers because of incorrect return logic on a database function

Removed ClearCorpseItems as it is no longer necessary as corpses deleted items appropriately when they are removed from the corpse
General cleanup of functions and variables in corpse code
This commit is contained in:
Akkadius
2014-11-25 22:47:50 -06:00
parent b4862dea45
commit 0598f7e87c
6 changed files with 150 additions and 105 deletions
-10
View File
@@ -3937,15 +3937,6 @@ uint32 ZoneDatabase::GetFirstCorpseID(uint32 char_id) {
return 0;
}
bool ZoneDatabase::ClearCorpseItems(uint32 db_id){
std::string query = StringFormat("DELETE FROM `character_corpse_items` WHERE `corpse_id` = %u", db_id);
auto results = QueryDatabase(query);
if (results.Success() && results.RowsAffected() != 0){
return true;
}
return false;
}
bool ZoneDatabase::DeleteItemOffCharacterCorpse(uint32 db_id, uint32 equip_slot, uint32 item_id){
std::string query = StringFormat("DELETE FROM `character_corpse_items` WHERE `corpse_id` = %u AND equip_slot = %u AND item_id = %u", db_id, equip_slot, item_id);
auto results = QueryDatabase(query);
@@ -3959,7 +3950,6 @@ bool ZoneDatabase::BuryCharacterCorpse(uint32 db_id) {
std::string query = StringFormat("UPDATE `character_corpses` SET `is_buried` = 1 WHERE `id` = %u", db_id);
auto results = QueryDatabase(query);
if (results.Success() && results.RowsAffected() != 0){
ClearCorpseItems(db_id);
return true;
}
return false;