diff --git a/zone/entity.cpp b/zone/entity.cpp index 8dd09bfab..7b427314b 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3835,17 +3835,18 @@ uint16 EntityList::CreateGroundObject(uint32 itemid, float x, float y, float z, return 0; // fell through everything, this is bad/incomplete from perl } -uint16 EntityList::CreateGroundObjectFromModel(const char *model, float x, - float y, float z, float heading, uint8 type, uint32 decay_time) +uint16 EntityList::CreateGroundObjectFromModel(const char *model, const xyz_heading& position, uint8 type, uint32 decay_time) { - if (model) { - Object *object = new Object(model, x, y, z, heading, type); - entity_list.AddObject(object, true); + if (!model) + return 0; - if (object) - return object->GetID(); - } - return 0; // fell through everything, this is bad/incomplete from perl + Object *object = new Object(model, position.m_X, position.m_Y, position.m_Z, position.m_Heading, type); + entity_list.AddObject(object, true); + + if (!object) + return 0; + + return object->GetID(); } uint16 EntityList::CreateDoor(const char *model, const xyz_heading& position, uint8 opentype, uint16 size) diff --git a/zone/entity.h b/zone/entity.h index 8e888a9b1..a992a3a5d 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -388,7 +388,7 @@ public: void ReloadAllClientsTaskState(int TaskID=0); 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 CreateGroundObjectFromModel(const char *model, const xyz_heading& position, uint8 type = 0x00, uint32 decay_time = 0); 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 165a37071..8c4de1aed 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2352,7 +2352,7 @@ uint16 QuestManager::CreateGroundObject(uint32 itemid, float x, float y, float z uint16 QuestManager::CreateGroundObjectFromModel(const char *model, float x, float y, float z, float heading, uint8 type, uint32 decay_time) { uint16 entid = 0; //safety check - entid = entity_list.CreateGroundObjectFromModel(model, x, y, z, heading, type, decay_time); + entid = entity_list.CreateGroundObjectFromModel(model, xyz_heading(x, y, z, heading), type, decay_time); return entid; }