summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-22 03:49:32 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-22 03:49:32 +0300
commit2d29847485933bf0e9ccbea4456f5473418d4b18 (patch)
tree73b85ee53e1c6898a97f118d7ebb2680e9d1ece4 /src
parent84f5ea2b062a1843286b1fdeff93e8936b914ca8 (diff)
downloadplus-2d29847485933bf0e9ccbea4456f5473418d4b18.tar.gz
plus-2d29847485933bf0e9ccbea4456f5473418d4b18.tar.bz2
plus-2d29847485933bf0e9ccbea4456f5473418d4b18.tar.xz
plus-2d29847485933bf0e9ccbea4456f5473418d4b18.zip
Add check for from equip index.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/inventoryrecv.cpp2
-rw-r--r--src/net/tmwa/inventoryrecv.cpp2
2 files changed, 4 insertions, 0 deletions
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]);
}