From 920bfaac5dada0ce2f99061e2b031aa6bd4c7214 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 25 Jan 2023 13:10:37 +0300 Subject: [PATCH] xrGame/Inventory.cpp: read SOC slots count correctly (#392) --- src/xrGame/Inventory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xrGame/Inventory.cpp b/src/xrGame/Inventory.cpp index 87a5f8c4f78..0a9470a775d 100644 --- a/src/xrGame/Inventory.cpp +++ b/src/xrGame/Inventory.cpp @@ -53,7 +53,9 @@ CInventory::CInventory() m_fMaxWeight = pSettings->r_float("inventory", "max_weight"); m_iMaxBelt = pSettings->read_if_exists("inventory", "max_belt", 5); - const u16 slotsCount = pSettings->read_if_exists("inventory", "slots_count", SLOTS_COUNT); + u16 slotsCount = SLOTS_COUNT; + pSettings->read_if_exists(slotsCount, "inventory", "slots_count", "slots"); // slots_count in CS/COP, slots in SOC + // slots_count + 1 because [0] is the inactive slot m_slots.reserve(slotsCount + 1u);