From 361b4d1c62bb4d05db7a331e7317b8749fd88c0e Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Tue, 2 Dec 2014 15:18:16 -0800 Subject: [PATCH] UnburyCharacterCorpse converted to xyz_heading --- zone/zonedb.cpp | 19 +++++++++++-------- zone/zonedb.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 239608473..f54846185 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3796,7 +3796,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z entity_list.AddCorpse(corpse); corpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS)); corpse->Spawn(); - if (!UnburyCharacterCorpse(corpse->GetDBID(), dest_zone_id, dest_instance_id, position.m_X, position.m_Y, position.m_Z, position.m_Heading)) + if (!UnburyCharacterCorpse(corpse->GetDBID(), dest_zone_id, dest_instance_id, position)) LogFile->write(EQEMuLog::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); } @@ -3842,15 +3842,18 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id return (CorpseCount > 0); } -bool ZoneDatabase::UnburyCharacterCorpse(uint32 db_id, uint32 new_zone_id, uint16 new_instance_id, float new_x, float new_y, float new_z, float new_heading) { - std::string query = StringFormat( - "UPDATE `character_corpses` SET `is_buried` = 0, `zone_id` = %u, `instance_id` = %u, `x` = %f, `y` = %f, `z` = %f, `heading` = %f, `time_of_death` = Now(), `was_at_graveyard` = 0 WHERE `id` = %u", - new_zone_id, new_instance_id, new_x, new_y, new_z, new_heading, db_id - ); +bool ZoneDatabase::UnburyCharacterCorpse(uint32 db_id, uint32 new_zone_id, uint16 new_instance_id, const xyz_heading& position) { + std::string query = StringFormat("UPDATE `character_corpses` " + "SET `is_buried` = 0, `zone_id` = %u, `instance_id` = %u, " + "`x` = %f, `y` = %f, `z` = %f, `heading` = %f, " + "`time_of_death` = Now(), `was_at_graveyard` = 0 " + "WHERE `id` = %u", + new_zone_id, new_instance_id, + position.m_X, position.m_Y, position.m_Z, position.m_Heading, db_id); auto results = QueryDatabase(query); - if (results.Success() && results.RowsAffected() != 0){ + if (results.Success() && results.RowsAffected() != 0) return true; - } + return false; } diff --git a/zone/zonedb.h b/zone/zonedb.h index ed2988048..b126efef4 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -305,7 +305,7 @@ public: bool DeleteCharacterCorpse(uint32 dbid); bool SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, const xyz_heading& position); bool SummonAllGraveyardCorpses(uint32 cur_zoneid, uint32 dest_zoneid, uint16 dest_instanceid, const xyz_heading& position); - bool UnburyCharacterCorpse(uint32 dbid, uint32 new_zoneid, uint16 dest_instanceid, float new_x, float new_y, float new_z, float new_heading); + bool UnburyCharacterCorpse(uint32 dbid, uint32 new_zoneid, uint16 dest_instanceid, const xyz_heading& position); bool LoadCharacterCorpses(uint32 iZoneID, uint16 iInstanceID); bool DeleteGraveyard(uint32 zone_id, uint32 graveyard_id); uint32 GetCharacterCorpseDecayTimer(uint32 corpse_db_id);