diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-10-06 20:20:36 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-10-06 20:20:36 +0000 |
commit | 09db562f2fca5c49fa1a92ba0b6dc60db479ae08 (patch) | |
tree | 6e3b607ceaf02558423b8f7f3beb108b3d6b2d53 /src/inventory.cpp | |
parent | 4a43cb1c6e5ba304d70df7066c61c52718a5f249 (diff) | |
download | mana-09db562f2fca5c49fa1a92ba0b6dc60db479ae08.tar.gz mana-09db562f2fca5c49fa1a92ba0b6dc60db479ae08.tar.bz2 mana-09db562f2fca5c49fa1a92ba0b6dc60db479ae08.tar.xz mana-09db562f2fca5c49fa1a92ba0b6dc60db479ae08.zip |
Transition to SDL integer types. Some int vs. long issues fixed. Return NULL when requesting an invalid inventory item.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 39860261..63fbab7a 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -44,6 +44,11 @@ Inventory::~Inventory() Item* Inventory::getItem(int index) { + if (index < 0 || index > INVENTORY_SIZE) + { + return 0; + } + return &items[index]; } |