From 4aeedb10f22d0dc307c9f733d0f1c79b70b9c200 Mon Sep 17 00:00:00 2001 From: Fate Date: Fri, 28 Nov 2008 21:22:10 -0700 Subject: Sanity-check index for Equipment::removeEquipment(int) --- src/equipment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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. -- cgit v1.2.3-70-g09d2