summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2012-08-03 21:42:19 +0400
committerAndrey Nazarov <skuller@skuller.net>2012-08-03 21:42:19 +0400
commit6f86bc2a62b2e5b7e562ec37d6cf176bf8fd205d (patch)
tree436799dd473aef7802137c188c3903eba459d94e
parent1a0f3820a8b34c976d9a2842f50914a38b511749 (diff)
Fix player setup menu crash.
Balance menu stack when menu->push() function fails. Prevents player setup menu from crashing when there are no player models found.
-rw-r--r--src/client/ui/ui.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/ui/ui.c b/src/client/ui/ui.c
index 812a21f..29da482 100644
--- a/src/client/ui/ui.c
+++ b/src/client/ui/ui.c
@@ -64,10 +64,9 @@ void UI_PushMenu(menuFrameWork_t *menu)
uis.menuDepth = i + 1;
}
- if (menu->push) {
- if (!menu->push(menu)) {
- return;
- }
+ if (menu->push && !menu->push(menu)) {
+ uis.menuDepth--;
+ return;
}
Menu_Init(menu);