MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / MoveToSlot

Method MoveToSlot

ogsr_engine/xrGame/script_game_object_inventory_owner.cpp:1202–1219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202bool CScriptGameObject::MoveToSlot(CScriptGameObject* obj, bool bNotActivate)
1203{
1204 CInventoryItem* inventory_item = smart_cast<CInventoryItem*>(&(obj->object()));
1205 if (!inventory_item)
1206 {
1207 ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "CInventoryItem : cannot access class member move_to_slot!");
1208 return false;
1209 }
1210
1211 CInventoryOwner* inventory_owner = smart_cast<CInventoryOwner*>(&object());
1212 if (!inventory_owner)
1213 {
1214 ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "CInventoryOwner : cannot access class member move_to_slot!");
1215 return false;
1216 }
1217
1218 return inventory_owner->inventory().Slot(inventory_item, bNotActivate);
1219}
1220
1221bool CScriptGameObject::MoveToBelt(CScriptGameObject* obj)
1222{

Callers

nothing calls this directly

Calls 4

script_logMethod · 0.80
objectFunction · 0.50
objectMethod · 0.45
SlotMethod · 0.45

Tested by

no test coverage detected