summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-12-30 02:06:53 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-12-30 02:06:53 (GMT)
commit5b21f4a66c77dbeaceb54b7a3ce3cde5efd7af3f (patch)
tree3000d7b1d85f6a031181454377f2c0920d319868 /src/interface.c
parent86369670aaa11b8cd2ddcbd46413fb9482e4e58f (diff)
parentf04577598b48c9e294b102395afc94023df8c92c (diff)
downloadpowder-5b21f4a66c77dbeaceb54b7a3ce3cde5efd7af3f.zip
powder-5b21f4a66c77dbeaceb54b7a3ce3cde5efd7af3f.tar.gz
Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c
index bb34c15..858af23 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -93,11 +93,18 @@ int drawgrav_enable = 0;
void menu_count(void)//puts the number of elements in each section into .itemcount
{
int i=0;
+ for (i=0;i<SC_TOTAL;i++)
+ {
+ msections[i].itemcount = 0;
+ }
msections[SC_LIFE].itemcount = NGOLALT;
msections[SC_WALL].itemcount = UI_WALLCOUNT-4;
for (i=0; i<PT_NUM; i++)
{
- msections[ptypes[i].menusection].itemcount+=ptypes[i].menu;
+ if (ptypes[i].menusection<SC_TOTAL)
+ {
+ msections[ptypes[i].menusection].itemcount+=ptypes[i].menu;
+ }
}
}