From 3791c38f97e03d3fa0c5281e42540dd0103c9fe1 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Tue, 2 Dec 2014 12:52:40 -0800 Subject: [PATCH] SummonAllCharacterCorpses converted to xyz_heading --- zone/client.cpp | 5 ++--- zone/zonedb.cpp | 15 +++++++-------- zone/zonedb.h | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 1bc23b38f..02c35feaa 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -4927,8 +4927,7 @@ void Client::SummonAndRezzAllCorpses() entity_list.RemoveAllCorpsesByCharID(CharacterID()); - int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(), - GetX(), GetY(), GetZ(), GetHeading()); + int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(), GetPosition()); if(CorpseCount <= 0) { Message(clientMessageYellow, "You have no corpses to summnon."); @@ -4966,7 +4965,7 @@ void Client::SummonAllCorpses(float dest_x, float dest_y, float dest_z, float de entity_list.RemoveAllCorpsesByCharID(CharacterID()); int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(), - dest_x, dest_y, dest_z, dest_heading); + xyz_heading(dest_x, dest_y, dest_z, dest_heading)); if(CorpseCount <= 0) { return; diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 762484411..7b8cb2d6d 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3806,21 +3806,20 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z return corpse; } -bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id, uint16 dest_instance_id, float dest_x, float dest_y, float dest_z, float dest_heading) { +bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id, uint16 dest_instance_id, const xyz_heading& position) { Corpse* NewCorpse = 0; int CorpseCount = 0; std::string query = StringFormat( "UPDATE character_corpses SET zone_id = %i, instance_id = %i, x = %f, y = %f, z = %f, heading = %f, is_buried = 0, was_at_graveyard = 0 WHERE charid = %i", - dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading, char_id + dest_zone_id, dest_instance_id, position.m_X, position.m_Y, position.m_Z, position.m_Heading, char_id ); auto results = QueryDatabase(query); query = StringFormat( "SELECT `id`, `charname`, `time_of_death`, `is_rezzed` FROM `character_corpses` WHERE `charid` = '%u'" "ORDER BY time_of_death", - char_id - ); + char_id); results = QueryDatabase(query); for (auto row = results.begin(); row != results.end(); ++row) { @@ -3828,10 +3827,10 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id atoll(row[0]), char_id, row[1], - dest_x, - dest_y, - dest_z, - dest_heading, + position.m_X, + position.m_Y, + position.m_Z, + position.m_Heading, row[2], atoi(row[3]) == 1, false); diff --git a/zone/zonedb.h b/zone/zonedb.h index ba9c6d924..e66448a47 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -303,7 +303,7 @@ public: bool BuryCharacterCorpse(uint32 dbid); bool BuryAllCharacterCorpses(uint32 charid); bool DeleteCharacterCorpse(uint32 dbid); - bool SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, float dest_x, float dest_y, float dest_z, float dest_heading); + 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, float dest_x, float dest_y, float dest_z, float dest_heading); bool UnburyCharacterCorpse(uint32 dbid, uint32 new_zoneid, uint16 dest_instanceid, float new_x, float new_y, float new_z, float new_heading); bool LoadCharacterCorpses(uint32 iZoneID, uint16 iInstanceID);