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
element = value;
graphic = el2panelimg(value);
- // printf("::: %d, '%s' [%d]\n", element, EL_NAME(element), size);
+#if 0
+ Debug("game:DisplayGameControlValues", "%d, '%s' [%d]",
+ element, EL_NAME(element), size);
+#endif
if (element >= EL_GRAPHIC_1 && element <= EL_GRAPHIC_8 && size == 0)
size = TILESIZE;
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)
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);
}
byte mapped_action[MAX_PLAYERS];
#if DEBUG_PLAYER_ACTIONS
- printf(":::");
for (i = 0; i < MAX_PLAYERS; i++)
- printf(" %d, ", stored_player[i].effective_action);
+ DebugContinued("", "%d, ", stored_player[i].effective_action);
#endif
for (i = 0; i < MAX_PLAYERS; i++)
stored_player[i].effective_action = mapped_action[i];
#if DEBUG_PLAYER_ACTIONS
- printf(" =>");
+ DebugContinued("", "=> ");
for (i = 0; i < MAX_PLAYERS; i++)
- printf(" %d, ", stored_player[i].effective_action);
- printf("\n");
+ DebugContinued("", "%d, ", stored_player[i].effective_action);
+ DebugContinued("game:playing:player", "\n");
#endif
}
#if DEBUG_PLAYER_ACTIONS
else
{
- printf(":::");
for (i = 0; i < MAX_PLAYERS; i++)
- printf(" %d, ", stored_player[i].effective_action);
- printf("\n");
+ DebugContinued("", "%d, ", stored_player[i].effective_action);
+ DebugContinued("game:playing:player", "\n");
}
#endif
#endif
CheckTriggeredElementChangeByPlayer(x, y, element, CE_PLAYER_DIGS_X,
player->index_bit, dig_side);
+ // if digging triggered player relocation, finish digging tile
+ if (mode == DF_DIG && (player->jx != jx || player->jy != jy))
+ setFieldForSnapping(x, y, element, move_direction);
+
if (mode == DF_SNAP)
{
if (level.block_snap_field)
PlayLevelSoundElementAction(x, y, element, ACTION_COLLECTING);
if (is_player)
+ {
CheckTriggeredElementChangeByPlayer(x, y, element, CE_PLAYER_COLLECTS_X,
player->index_bit, dig_side);
+ // if collecting triggered player relocation, finish collecting tile
+ if (mode == DF_DIG && (player->jx != jx || player->jy != jy))
+ setFieldForSnapping(x, y, element, move_direction);
+ }
+
if (mode == DF_SNAP)
{
if (level.block_snap_field)
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");
}
}
GDI_END);
if (gi == NULL)
- Error(ERR_EXIT, "cannot create gadget");
+ Fail("cannot create gadget");
game_gadget[id] = gi;
}