diff --git a/src/allmain.c b/src/allmain.c index d1fd65351..b37b5b03d 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -12,6 +12,8 @@ #include #endif +static void moveloop_preamble(boolean); +static void moveloop_core(void); #ifdef POSITIONBAR static void do_positionbar(void); #endif @@ -28,16 +30,9 @@ early_init(void) sys_early_init(); } -void -moveloop(boolean resuming) +static void +moveloop_preamble(boolean resuming) { -#if defined(MICRO) || defined(WIN32) - char ch; - int abort_lev; -#endif - int moveamt = 0, wtcap = 0, change = 0; - boolean monscanmove = FALSE; - /* if a save file created in normal mode is now being restored in explore mode, treat it as normal restore followed by 'X' command to use up the save file and require confirmation for explore mode */ @@ -88,6 +83,17 @@ moveloop(boolean resuming) invent is fully populated and the in_moveloop flag has been set */ if (iflags.perm_invent) update_inventory(); +} + +static void +moveloop_core(void) +{ +#if defined(MICRO) || defined(WIN32) + char ch; + int abort_lev; +#endif + int moveamt = 0, wtcap = 0, change = 0; + boolean monscanmove = FALSE; for (;;) { #ifdef SAFERHANGUP @@ -480,6 +486,13 @@ moveloop(boolean resuming) } } +void +moveloop(boolean resuming) +{ + moveloop_preamble(resuming); + moveloop_core(); +} + #define U_CAN_REGEN() (Regeneration || (Sleepy && u.usleep)) /* maybe recover some lost health (or lose some when an eel out of water) */