MCPcopy Create free account
hub / github.com/EQEmu/EQEmu / AddObject

Method AddObject

zone/object.cpp:795–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

793}
794
795uint32 ZoneDatabase::AddObject(
796 uint32 type,
797 uint32 icon,
798 const Object_Struct& o,
799 const EQ::ItemInstance* inst
800)
801{
802 uint32 item_id = 0;
803 int16 charges = 0;
804
805 if (inst && inst->GetItem()) {
806 item_id = inst->GetItem()->ID;
807 charges = inst->GetCharges();
808 }
809
810 auto e = ObjectRepository::NewEntity();
811
812 e.zoneid = o.zone_id;
813 e.xpos = o.x;
814 e.ypos = o.y;
815 e.zpos = o.z;
816 e.heading = o.heading;
817 e.itemid = item_id;
818 e.charges = charges;
819 e.objectname = o.object_name;
820 e.type = type;
821 e.icon = icon;
822
823 e = ObjectRepository::InsertOne(*this, e);
824
825 if (!e.id) {
826 return 0;
827 }
828
829 if (inst && inst->IsType(EQ::item::ItemClassBag)) {
830 SaveWorldContainer(o.zone_id, e.id, inst);
831 }
832
833 return e.id;
834}
835
836void ZoneDatabase::UpdateObject(
837 uint32 object_id,

Callers 8

DropItemMethod · 0.45
DropInstMethod · 0.45
SaveMethod · 0.45
VarSaveMethod · 0.45
LoadZoneObjectsMethod · 0.45
LoadGroundSpawnsMethod · 0.45
DisarmMethod · 0.45
CommandHandlerMethod · 0.45

Calls 3

GetItemMethod · 0.45
GetChargesMethod · 0.45
IsTypeMethod · 0.45

Tested by

no test coverage detected