summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/inventory.h b/src/inventory.h
index a690eb5ae..7d7e58d61 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -80,15 +80,14 @@ struct ItemStack
// Maximum size of a stack
u16 getStackMax(IItemDefManager *itemdef) const
{
- s16 max = itemdef->get(name).stack_max;
- return (max >= 0) ? max : 0;
+ return itemdef->get(name).stack_max;
}
// Number of items that can be added to this stack
u16 freeSpace(IItemDefManager *itemdef) const
{
u16 max = getStackMax(itemdef);
- if(count > max)
+ if (count >= max)
return 0;
return max - count;
}