diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 45086093c..034c9e80e 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -269,7 +269,8 @@ XS(XS__unique_spawn) if(items == 7) heading = (float)SvNV(ST(6)); - Mob *r = quest_manager.unique_spawn(npc_type, grid, unused, x, y, z, heading); + + Mob *r = quest_manager.unique_spawn(npc_type, grid, unused, xyz_heading(x, y, z, heading)); RETVAL = (r != nullptr) ? r->GetID() : 0; XSprePUSH; PUSHu((UV)RETVAL); diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 915efe780..99e802c24 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -256,8 +256,8 @@ Lua_Mob lua_spawn2(int npc_type, int grid, int unused, double x, double y, doubl } Lua_Mob lua_unique_spawn(int npc_type, int grid, int unused, double x, double y, double z, double heading = 0.0) { - return Lua_Mob(quest_manager.unique_spawn(npc_type, grid, unused, - static_cast(x), static_cast(y), static_cast(z), static_cast(heading))); + auto position = xyz_heading(x,y,z,heading); + return Lua_Mob(quest_manager.unique_spawn(npc_type, grid, unused, position)); } Lua_Mob lua_spawn_from_spawn2(uint32 spawn2_id) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 48c94f1cc..3ced16e87 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -258,7 +258,7 @@ Mob* QuestManager::spawn2(int npc_type, int grid, int unused, const xyz_heading& return nullptr; } -Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, float x, float y, float z, float heading) { +Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, const xyz_heading& position) { Mob *other = entity_list.GetMobByNpcTypeID(npc_type); if(other != nullptr) { return other; @@ -267,7 +267,7 @@ Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, float x, flo const NPCType* tmp = 0; if (tmp = database.GetNPCType(npc_type)) { - NPC* npc = new NPC(tmp, nullptr, xyz_heading(x, y, z, heading), FlyMode3); + NPC* npc = new NPC(tmp, nullptr, position, FlyMode3); npc->AddLootTable(); entity_list.AddNPC(npc,true,true); if(grid > 0) diff --git a/zone/questmgr.h b/zone/questmgr.h index 072fceb31..a46b7adcd 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -57,7 +57,7 @@ public: void summonitem(uint32 itemid, int16 charges = -1); void write(const char *file, const char *str); Mob* spawn2(int npc_type, int grid, int unused, const xyz_heading& position); - Mob* unique_spawn(int npc_type, int grid, int unused, float x, float y, float z, float heading = 0); + Mob* unique_spawn(int npc_type, int grid, int unused, const xyz_heading& position); Mob* spawn_from_spawn2(uint32 spawn2_id); void enable_spawn2(uint32 spawn2_id); void disable_spawn2(uint32 spawn2_id);