X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=8b77ddef674f65d232e0c968c5e4c5ef9529870f;hb=023dd1a5d064b6a2fbfb8145af8c61261ea53886;hp=ee3e97891eca48f6ce918a4a5bbae434c8b1c6f7;hpb=a99a1803e5097bc598b4c6f73259715da148ab27;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index ee3e9789..8b77ddef 100644 --- a/src/game.c +++ b/src/game.c @@ -2147,8 +2147,9 @@ static void InitGameControlValues(void) if (nr != i) { - Error(ERR_INFO, "'game_panel_controls' structure corrupted at %d", i); - Error(ERR_EXIT, "this should not happen -- please debug"); + Error("'game_panel_controls' structure corrupted at %d", i); + + Fail("this should not happen -- please debug"); } // force update of game controls after initialization @@ -11199,6 +11200,15 @@ static void CheckSaveEngineSnapshot(struct PlayerInfo *player) if (!player->is_dropping) player->was_dropping = FALSE; } + + static struct MouseActionInfo mouse_action_last = { 0 }; + struct MouseActionInfo mouse_action = player->effective_mouse_action; + boolean new_released = (!mouse_action.button && mouse_action_last.button); + + if (new_released) + CheckSaveEngineSnapshotToList(); + + mouse_action_last = mouse_action; } static void CheckSingleStepMode(struct PlayerInfo *player) @@ -11209,7 +11219,8 @@ static void CheckSingleStepMode(struct PlayerInfo *player) player stopped moving after one tile (or never starts moving at all) */ if (!player->is_moving && !player->is_pushing && - !player->is_dropping_pressed) + !player->is_dropping_pressed && + !player->effective_mouse_action.button) TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); } @@ -11660,9 +11671,8 @@ static void GameActionsExt(void) byte mapped_action[MAX_PLAYERS]; #if DEBUG_PLAYER_ACTIONS - Print(":::"); for (i = 0; i < MAX_PLAYERS; i++) - Print(" %d, ", stored_player[i].effective_action); + DebugContinued("", "%d, ", stored_player[i].effective_action); #endif for (i = 0; i < MAX_PLAYERS; i++) @@ -11672,19 +11682,18 @@ static void GameActionsExt(void) stored_player[i].effective_action = mapped_action[i]; #if DEBUG_PLAYER_ACTIONS - Print(" =>"); + DebugContinued("", "=> "); for (i = 0; i < MAX_PLAYERS; i++) - Print(" %d, ", stored_player[i].effective_action); - Print("\n"); + DebugContinued("", "%d, ", stored_player[i].effective_action); + DebugContinued("game:playing:player", "\n"); #endif } #if DEBUG_PLAYER_ACTIONS else { - Print(":::"); for (i = 0; i < MAX_PLAYERS; i++) - Print(" %d, ", stored_player[i].effective_action); - Print("\n"); + DebugContinued("", "%d, ", stored_player[i].effective_action); + DebugContinued("game:playing:player", "\n"); } #endif #endif @@ -15424,10 +15433,11 @@ static void LoadEngineSnapshotValues_RND(void) if (game.num_random_calls != num_random_calls) { - Error(ERR_INFO, "number of random calls out of sync"); - Error(ERR_INFO, "number of random calls should be %d", num_random_calls); - Error(ERR_INFO, "number of random calls is %d", game.num_random_calls); - Error(ERR_EXIT, "this should not happen -- please debug"); + Error("number of random calls out of sync"); + Error("number of random calls should be %d", num_random_calls); + Error("number of random calls is %d", game.num_random_calls); + + Fail("this should not happen -- please debug"); } } @@ -15836,7 +15846,7 @@ void CreateGameButtons(void) GDI_END); if (gi == NULL) - Error(ERR_EXIT, "cannot create gadget"); + Fail("cannot create gadget"); game_gadget[id] = gi; }