diff --git a/res/gamedata/configs/openxray.ltx b/res/gamedata/configs/openxray.ltx index 33a5386167b..a97091cc2af 100644 --- a/res/gamedata/configs/openxray.ltx +++ b/res/gamedata/configs/openxray.ltx @@ -35,3 +35,7 @@ game_mode = cop ; Always try to put item in the slot, SOC behaviour ; For the comparison, COP tries to do that only if item has default_to_ruck = false default_to_slot = false + +; SOC/CS slots ordering +; e.g. knife slot is 0 in SOC/CS and 1 in COP +minus_one_slot_ordering = false diff --git a/src/xrGame/script_game_object_inventory_owner.cpp b/src/xrGame/script_game_object_inventory_owner.cpp index b36b6d54899..519ef41d3ec 100644 --- a/src/xrGame/script_game_object_inventory_owner.cpp +++ b/src/xrGame/script_game_object_inventory_owner.cpp @@ -1258,6 +1258,9 @@ CScriptGameObject* CScriptGameObject::item_in_slot(u32 slot_id) const return (0); } + if (pSettingsOpenXRay->read_if_exists("compatibility", "minus_one_slot_ordering", ShadowOfChernobylMode || ClearSkyMode)) + ++slot_id; + CInventoryItem* result = inventory_owner->inventory().ItemFromSlot((u16)slot_id); return (result ? result->object().lua_game_object() : 0); }