diff --git a/zone/entity.cpp b/zone/entity.cpp index 1c17be825..8dd09bfab 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3848,19 +3848,20 @@ uint16 EntityList::CreateGroundObjectFromModel(const char *model, float x, return 0; // fell through everything, this is bad/incomplete from perl } -uint16 EntityList::CreateDoor(const char *model, float x, float y, float z, - float heading, uint8 opentype, uint16 size) +uint16 EntityList::CreateDoor(const char *model, const xyz_heading& position, uint8 opentype, uint16 size) { - if (model) { - Doors *door = new Doors(model, xyz_heading(x, y, z, heading), opentype, size); - RemoveAllDoors(); - zone->LoadZoneDoors(zone->GetShortName(), zone->GetInstanceVersion()); - entity_list.AddDoor(door); - entity_list.RespawnAllDoors(); + if (!model) + return 0; // fell through everything, this is bad/incomplete from perl + + Doors *door = new Doors(model, position, opentype, size); + RemoveAllDoors(); + zone->LoadZoneDoors(zone->GetShortName(), zone->GetInstanceVersion()); + entity_list.AddDoor(door); + entity_list.RespawnAllDoors(); + + if (door) + return door->GetEntityID(); - if (door) - return door->GetEntityID(); - } return 0; // fell through everything, this is bad/incomplete from perl } diff --git a/zone/entity.h b/zone/entity.h index 486f1d49f..8e888a9b1 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -26,6 +26,7 @@ #include "../common/bodytypes.h" #include "../common/eq_constants.h" +#include "position.h" #include "zonedb.h" #include "zonedump.h" #include "qglobals.h" @@ -52,7 +53,7 @@ class Bot; class BotRaids; #endif -extern EntityList entity_list; +extern EntityList entity_list; class Entity { @@ -388,7 +389,7 @@ public: uint16 CreateGroundObject(uint32 itemid, float x, float y, float z, float heading, uint32 decay_time = 300000); uint16 CreateGroundObjectFromModel(const char *model, float x, float y, float z, float heading, uint8 type = 0x00, uint32 decay_time = 0); - uint16 CreateDoor(const char *model, float x, float y, float z, float heading, uint8 type = 0, uint16 size = 100); + uint16 CreateDoor(const char *model, const xyz_heading& position, uint8 type = 0, uint16 size = 100); void ZoneWho(Client *c, Who_All_Struct* Who); void UnMarkNPC(uint16 ID); diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index bcef4ef98..165a37071 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2878,7 +2878,7 @@ void QuestManager::SendMail(const char *to, const char *from, const char *subjec uint16 QuestManager::CreateDoor(const char* model, float x, float y, float z, float heading, uint8 opentype, uint16 size) { uint16 entid = 0; //safety check - entid = entity_list.CreateDoor(model, x, y, z, heading, opentype, size); + entid = entity_list.CreateDoor(model, xyz_heading(x, y, z, heading), opentype, size); return entid; }