/*---------------------------------------------------------------------------*/
-int goto_end_level(void)
-{
- switch (curr_lg()->mode)
- {
- case MODE_CHALLENGE:
- return goto_state(&st_over);
- default:
- return goto_state(&st_start);
- }
-}
-
-
-/*---------------------------------------------------------------------------*/
-
-#define START_BACK -1
-#define START_PRACTICE -2
-#define START_NORMAL -3
+#define START_BACK -1
+#define START_PRACTICE -2
+#define START_NORMAL -3
#define START_CHALLENGE -4
static int shot_id;
static void start_over_level(int i)
{
const struct level *l = get_level(i);
- if (!l->is_locked || config_get_d(CONFIG_CHEAT))
+ if (!l->is_locked || config_cheat())
{
gui_set_image(shot_id, l->shot);
else
gui_set_label(status_id, _("Play this level in normal mode"));
}
- if (config_get_d(CONFIG_CHEAT))
+ if (config_cheat())
{
gui_set_label(status_id, l->file);
}
if (i == START_CHALLENGE)
{
/* On cheat, start challenge mode where you want */
- if (config_get_d(CONFIG_CHEAT))
+ if (config_cheat())
{
mode_set(MODE_CHALLENGE);
return goto_state(&st_start);
{
const struct level *l = get_level(i);
- if (!l->is_locked || config_get_d(CONFIG_CHEAT))
+ if (!l->is_locked || config_cheat())
{
- level_play(l, mode);
- return goto_state(&st_level);
+ if (level_play(l, mode))
+ {
+ return goto_state(&st_level);
+ }
+ else
+ {
+ level_stop();
+ return 1;
+ }
}
}
return 1;
/* Deactivate cheat */
- if (m == MODE_CHALLENGE && !config_get_d(CONFIG_CHEAT))
+ if (m == MODE_CHALLENGE && !config_cheat())
{
mode_set(MODE_NORMAL);
m = MODE_NORMAL;
static int start_keybd(int c, int d)
{
- if (d && c == SDLK_c && config_get_d(CONFIG_CHEAT))
+ if (d && c == SDLK_c && config_cheat())
{
set_cheat();
return goto_state(&st_start);