EntityList::CreateGroundObject converted to xyz_heading

This commit is contained in:
Arthur Ice 2014-11-30 21:30:16 -08:00
parent d54215ea18
commit c3471ed88e
3 changed files with 17 additions and 16 deletions

View File

@ -3816,24 +3816,25 @@ void EntityList::GroupMessage(uint32 gid, const char *from, const char *message)
}
}
uint16 EntityList::CreateGroundObject(uint32 itemid, float x, float y, float z,
float heading, uint32 decay_time)
uint16 EntityList::CreateGroundObject(uint32 itemid, const xyz_heading& position, uint32 decay_time)
{
const Item_Struct *is = database.GetItem(itemid);
if (is) {
if (!is)
return 0;
ItemInst *i = new ItemInst(is, is->MaxCharges);
if (i) {
Object *object = new Object(i, x, y, z, heading,decay_time);
if (!i)
return 0;
Object *object = new Object(i, position.m_X, position.m_Y, position.m_Z, position.m_Heading,decay_time);
entity_list.AddObject(object, true);
safe_delete(i);
if (object)
if (!object)
return 0;
return object->GetID();
}
return 0; // fell through itemstruct
}
return 0; // fell through everything, this is bad/incomplete from perl
}
uint16 EntityList::CreateGroundObjectFromModel(const char *model, const xyz_heading& position, uint8 type, uint32 decay_time)
{

View File

@ -387,7 +387,7 @@ public:
void SaveAllClientsTaskState();
void ReloadAllClientsTaskState(int TaskID=0);
uint16 CreateGroundObject(uint32 itemid, float x, float y, float z, float heading, uint32 decay_time = 300000);
uint16 CreateGroundObject(uint32 itemid, const xyz_heading& position, uint32 decay_time = 300000);
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);

View File

@ -2345,7 +2345,7 @@ int QuestManager::getlevel(uint8 type)
uint16 QuestManager::CreateGroundObject(uint32 itemid, float x, float y, float z, float heading, uint32 decay_time)
{
uint16 entid = 0; //safety check
entid = entity_list.CreateGroundObject(itemid, x, y, z, heading, decay_time);
entid = entity_list.CreateGroundObject(itemid, xyz_heading(x, y, z, heading), decay_time);
return entid;
}