From efc4ba0e27e89816c906001bd124a7649840d956 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Tue, 2 Dec 2014 12:00:45 -0800 Subject: [PATCH] summonburriedplayercorpse converted to xyz_heading --- zone/embparser_api.cpp | 7 ++----- zone/lua_general.cpp | 2 +- zone/questmgr.cpp | 17 +++++++++-------- zone/questmgr.h | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 3ec5801ef..ba2e397b5 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -1747,12 +1747,9 @@ XS(XS__summonburriedplayercorpse) bool RETVAL; uint32 char_id = (int)SvIV(ST(0)); - float dest_x = (float)SvIV(ST(1)); - float dest_y = (float)SvIV(ST(2)); - float dest_z = (float)SvIV(ST(3)); - float dest_heading = (float)SvIV(ST(4)); + auto position = xyz_heading((float)SvIV(ST(1)), (float)SvIV(ST(2)), (float)SvIV(ST(3)),(float)SvIV(ST(4))); - RETVAL = quest_manager.summonburriedplayercorpse(char_id, dest_x, dest_y, dest_z, dest_heading); + RETVAL = quest_manager.summonburriedplayercorpse(char_id, position); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 9238278cc..7d619803a 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -485,7 +485,7 @@ void lua_toggle_spawn_event(int event_id, bool enable, bool strict, bool reset) } void lua_summon_burried_player_corpse(uint32 char_id, float x, float y, float z, float h) { - quest_manager.summonburriedplayercorpse(char_id, x, y, z, h); + quest_manager.summonburriedplayercorpse(char_id, xyz_heading(x, y, z, h)); } void lua_summon_all_player_corpses(uint32 char_id, float x, float y, float z, float h) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index e8da20496..d4e914204 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -1734,16 +1734,17 @@ void QuestManager::sethp(int hpperc) { owner->Damage(owner, newhp, SPELL_UNKNOWN, SkillHandtoHand, false, 0, false); } -bool QuestManager::summonburriedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading) { +bool QuestManager::summonburriedplayercorpse(uint32 char_id, const xyz_heading& position) { bool Result = false; - if(char_id > 0) { - Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(char_id, zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading); - if(PlayerCorpse) { - Result = true; - } - } - return Result; + if(char_id <= 0) + return false; + + Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(char_id, zone->GetZoneID(), zone->GetInstanceID(), position.m_X, position.m_Y, position.m_Z, position.m_Heading); + if(!PlayerCorpse) + return false; + + return true; } bool QuestManager::summonallplayercorpses(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading) { diff --git a/zone/questmgr.h b/zone/questmgr.h index 4a01a6e49..c6c28111e 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -156,7 +156,7 @@ public: void set_zone_flag(int zone_id); void clear_zone_flag(int zone_id); void sethp(int hpperc); - bool summonburriedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading); + bool summonburriedplayercorpse(uint32 char_id, const xyz_heading& position); bool summonallplayercorpses(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading); uint32 getplayerburriedcorpsecount(uint32 char_id); bool buryplayercorpse(uint32 char_id);