EntityList::CreateDoor converted to xyz_heading

This commit is contained in:
Arthur Ice 2014-11-30 21:04:39 -08:00
parent 7ac9a5c5a6
commit 4f03ebb3af
3 changed files with 16 additions and 14 deletions

View File

@ -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
}

View File

@ -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);

View File

@ -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;
}