From 2d29847485933bf0e9ccbea4456f5473418d4b18 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 22 Mar 2016 03:49:32 +0300 Subject: Add check for from equip index. --- src/net/eathena/inventoryrecv.cpp | 2 ++ src/net/tmwa/inventoryrecv.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index cc639e6e3..8bc93208f 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -1154,6 +1154,8 @@ int InventoryRecv::getSlot(const int eAthenaSlot) mask <<= 1; position++; } + if (position >= EquipSlot::VECTOREND) + return EquipSlot::VECTOREND; return CAST_S32(EQUIP_POINTS[position]); } diff --git a/src/net/tmwa/inventoryrecv.cpp b/src/net/tmwa/inventoryrecv.cpp index 30e30502d..6e1fe0cfe 100644 --- a/src/net/tmwa/inventoryrecv.cpp +++ b/src/net/tmwa/inventoryrecv.cpp @@ -530,6 +530,8 @@ int InventoryRecv::getSlot(const int eAthenaSlot) mask <<= 1; position++; } + if (position >= EquipSlot::VECTOREND) + return EquipSlot::VECTOREND; return CAST_S32(EQUIP_POINTS[position]); } -- cgit v1.2.3-70-g09d2