summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-12-24 23:44:00 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-12-28 22:39:59 (GMT)
commit2553dac942b9b5c3ad6b834d32c9053d3592faaf (patch)
tree149c3e053f938c0f6a4e556aea4f408b180d2be4 /src/interface.c
parent23d6823bc3b877451e40103d2007dee9ddb10cb0 (diff)
downloadpowder-2553dac942b9b5c3ad6b834d32c9053d3592faaf.zip
powder-2553dac942b9b5c3ad6b834d32c9053d3592faaf.tar.gz
Update can_move, recount menu items and clear graphics cache when tpt.el is changed
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 472fd9b..f62bd51 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -92,11 +92,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;
+ }
}
}