Split moveloop into preamble and core
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void moveloop_preamble(boolean);
|
||||||
|
static void moveloop_core(void);
|
||||||
#ifdef POSITIONBAR
|
#ifdef POSITIONBAR
|
||||||
static void do_positionbar(void);
|
static void do_positionbar(void);
|
||||||
#endif
|
#endif
|
||||||
@@ -28,16 +30,9 @@ early_init(void)
|
|||||||
sys_early_init();
|
sys_early_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
moveloop(boolean resuming)
|
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
|
/* if a save file created in normal mode is now being restored in
|
||||||
explore mode, treat it as normal restore followed by 'X' command
|
explore mode, treat it as normal restore followed by 'X' command
|
||||||
to use up the save file and require confirmation for explore mode */
|
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 */
|
invent is fully populated and the in_moveloop flag has been set */
|
||||||
if (iflags.perm_invent)
|
if (iflags.perm_invent)
|
||||||
update_inventory();
|
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 (;;) {
|
for (;;) {
|
||||||
#ifdef SAFERHANGUP
|
#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))
|
#define U_CAN_REGEN() (Regeneration || (Sleepy && u.usleep))
|
||||||
|
|
||||||
/* maybe recover some lost health (or lose some when an eel out of water) */
|
/* maybe recover some lost health (or lose some when an eel out of water) */
|
||||||
|
|||||||
Reference in New Issue
Block a user