mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 15:08:22 +00:00
[Objects] Add fix_z column to ground spawns (#3992)
* [Objects] Add is_floating column to objects/ground spawns # Notes - Allows ground spawns/objects to float without having `FixZ()` called. * Remove from object. * Database version * Fix * Change to fix_z
This commit is contained in:
+18
-10
@@ -4641,36 +4641,44 @@ void EntityList::GroupMessage(uint32 gid, const char *from, const char *message)
|
||||
}
|
||||
}
|
||||
|
||||
uint16 EntityList::CreateGroundObject(uint32 itemid, const glm::vec4& position, uint32 decay_time)
|
||||
uint16 EntityList::CreateGroundObject(uint32 item_id, const glm::vec4& position, uint32 decay_time)
|
||||
{
|
||||
const EQ::ItemData *is = database.GetItem(itemid);
|
||||
if (!is)
|
||||
const auto is = database.GetItem(item_id);
|
||||
if (!is) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto i = new EQ::ItemInstance(is, is->MaxCharges);
|
||||
if (!i)
|
||||
auto inst = new EQ::ItemInstance(is, is->MaxCharges);
|
||||
if (!inst) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto object = new Object(inst, position.x, position.y, position.z, position.w, decay_time);
|
||||
|
||||
auto object = new Object(i, position.x, position.y, position.z, position.w, decay_time);
|
||||
entity_list.AddObject(object, true);
|
||||
|
||||
safe_delete(i);
|
||||
if (!object)
|
||||
safe_delete(inst);
|
||||
|
||||
if (!object) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return object->GetID();
|
||||
}
|
||||
|
||||
uint16 EntityList::CreateGroundObjectFromModel(const char *model, const glm::vec4& position, uint8 type, uint32 decay_time)
|
||||
{
|
||||
if (!model)
|
||||
if (!model) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto object = new Object(model, position.x, position.y, position.z, position.w, type);
|
||||
|
||||
entity_list.AddObject(object, true);
|
||||
|
||||
if (!object)
|
||||
if (!object) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return object->GetID();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user