if (game_mm.kettles_still_needed > 0)
game_mm.kettles_still_needed--;
+ game.snapshot.collected_item = TRUE;
+
if (game_mm.kettles_still_needed == 0)
{
CheckExitMM();
laser.redraw = TRUE;
}
-void ClickElement(int x, int y, int button)
+boolean ClickElement(int x, int y, int button)
{
static unsigned int click_delay = 0;
static int click_delay_value = CLICK_DELAY;
static boolean new_button = TRUE;
+ boolean element_clicked = FALSE;
int element;
if (button == -1)
click_delay_value = CLICK_DELAY;
new_button = TRUE;
- return;
+ return FALSE;
}
/* do not rotate objects hit by the laser after the game was solved */
if (game_mm.level_solved && Hit[x][y])
- return;
+ return FALSE;
if (button == MB_RELEASED)
{
/* release eventually hold auto-rotating mirror */
RotateMirror(x, y, MB_RELEASED);
- return;
+ return FALSE;
}
if (!FrameReached(&click_delay, click_delay_value) && !new_button)
- return;
+ return FALSE;
if (button == MB_MIDDLEBUTTON) /* middle button has no function */
- return;
+ return FALSE;
if (!IN_LEV_FIELD(x, y))
- return;
+ return FALSE;
if (Feld[x][y] == EL_EMPTY)
- return;
+ return FALSE;
element = Feld[x][y];
IS_DF_MIRROR_AUTO(element))
{
RotateMirror(x, y, button);
+
+ element_clicked = TRUE;
}
else if (IS_MCDUFFIN(element))
{
if (!laser.fuse_off)
ScanLaser();
+
+ element_clicked = TRUE;
}
else if (element == EL_FUSE_ON && laser.fuse_off)
{
if (x != laser.fuse_x || y != laser.fuse_y)
- return;
+ return FALSE;
laser.fuse_off = FALSE;
laser.fuse_x = laser.fuse_y = -1;
DrawGraphic_MM(x, y, IMG_MM_FUSE_ACTIVE);
ScanLaser();
+
+ element_clicked = TRUE;
}
else if (element == EL_FUSE_ON && !laser.fuse_off && new_button)
{
DrawLaser(0, DL_LASER_DISABLED);
DrawGraphic_MM(x, y, IMG_MM_FUSE);
+
+ element_clicked = TRUE;
}
else if (element == EL_LIGHTBALL)
{
Bang_MM(x, y);
RaiseScoreElement_MM(element);
DrawLaser(0, DL_LASER_ENABLED);
+
+ element_clicked = TRUE;
}
click_delay_value = (new_button ? CLICK_DELAY_FIRST : CLICK_DELAY);
new_button = FALSE;
+
+ return element_clicked;
}
void RotateMirror(int x, int y, int button)
void GameActions_MM(struct MouseActionInfo action, boolean warp_mode)
{
- ClickElement(action.lx, action.ly, action.button);
+ boolean element_clicked = ClickElement(action.lx, action.ly, action.button);
+ boolean button_released = (action.button == MB_RELEASED);
GameActions_MM_Ext(action, warp_mode);
- CheckSingleStepMode_MM(action.button == MB_RELEASED);
+ CheckSingleStepMode_MM(element_clicked, button_released);
}
void MovePacMen()
}
}
-void CheckSaveEngineSnapshot_MM(boolean button_released)
+void CheckSaveEngineSnapshot_MM(boolean element_clicked,
+ boolean button_released)
{
- CheckSaveEngineSnapshotToList();
+ if (button_released)
+ {
+ if (game.snapshot.mode == SNAPSHOT_MODE_EVERY_MOVE)
+ CheckSaveEngineSnapshotToList();
+ }
+ else if (element_clicked)
+ {
+ if (game.snapshot.mode != SNAPSHOT_MODE_EVERY_MOVE)
+ CheckSaveEngineSnapshotToList();
+
+ game.snapshot.changed_action = TRUE;
+ }
}
void CheckSingleStepMode_EM(byte action[MAX_PLAYERS], int frame,
CheckSaveEngineSnapshot_SP(murphy_is_waiting, murphy_is_dropping);
}
-void CheckSingleStepMode_MM(boolean button_released)
+void CheckSingleStepMode_MM(boolean element_clicked,
+ boolean button_released)
{
if (tape.single_step && tape.recording && !tape.pausing)
if (button_released)
TapeTogglePause(TAPE_TOGGLE_AUTOMATIC);
- CheckSaveEngineSnapshot_MM(button_released);
+ CheckSaveEngineSnapshot_MM(element_clicked, button_released);
}
void getGraphicSource_SP(struct GraphicInfo_SP *g_sp,