summaryrefslogtreecommitdiff
path: root/src/equipment.h
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2008-11-28 21:22:10 -0700
committerFate <fate-tmw@googlemail.com>2008-11-28 21:22:10 -0700
commit4aeedb10f22d0dc307c9f733d0f1c79b70b9c200 (patch)
treecc507e2bc5c0616658190cf0d657eb004ba6117e /src/equipment.h
parentb5ef3811e697a6a4dc963399424115c53502a4e5 (diff)
downloadmana-client-4aeedb10f22d0dc307c9f733d0f1c79b70b9c200.tar.gz
mana-client-4aeedb10f22d0dc307c9f733d0f1c79b70b9c200.tar.bz2
mana-client-4aeedb10f22d0dc307c9f733d0f1c79b70b9c200.tar.xz
mana-client-4aeedb10f22d0dc307c9f733d0f1c79b70b9c200.zip
Sanity-check index for Equipment::removeEquipment(int)
Diffstat (limited to 'src/equipment.h')
-rw-r--r--src/equipment.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/equipment.h b/src/equipment.h
index 28a96baa..e6145d12 100644
--- a/src/equipment.h
+++ b/src/equipment.h
@@ -48,7 +48,7 @@ class Equipment
/**
* Remove equipment from the given slot.
*/
- void removeEquipment(int index) { mEquipment[index] = 0; }
+ void removeEquipment(int index) { if (index >= 0 && index < EQUIPMENT_SIZE) mEquipment[index] = 0; }
/**
* Returns the item used in the arrow slot.