projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improved robustness of client/server encoding functions
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index a3cc0704876dc6b065c503b4a7a75fe2f988ac9c..c3dc82cc2631d07c03bc56ce83bb4b3e9ddd6e8a 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-13968,7
+13968,11
@@
static void TestFieldAfterSnapping(int x, int y, int element, int direction,
if (level.finish_dig_collect)
{
int dig_side = MV_DIR_OPPOSITE(direction);
if (level.finish_dig_collect)
{
int dig_side = MV_DIR_OPPOSITE(direction);
+ int change_event = (IS_DIGGABLE(element) ? CE_PLAYER_DIGS_X :
+ CE_PLAYER_COLLECTS_X);
+ CheckTriggeredElementChangeByPlayer(x, y, element, change_event,
+ player_index_bit, dig_side);
CheckTriggeredElementChangeByPlayer(x, y, element, CE_PLAYER_SNAPS_X,
player_index_bit, dig_side);
}
CheckTriggeredElementChangeByPlayer(x, y, element, CE_PLAYER_SNAPS_X,
player_index_bit, dig_side);
}
@@
-16162,12
+16166,18
@@
static void UnmapGameButtonsAtSamePosition(int id)
static void UnmapGameButtonsAtSamePosition_All(void)
{
static void UnmapGameButtonsAtSamePosition_All(void)
{
- if (setup.show_
snapshot
_buttons)
+ if (setup.show_
load_save
_buttons)
{
UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_SAVE);
UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PAUSE2);
UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_LOAD);
}
{
UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_SAVE);
UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PAUSE2);
UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_LOAD);
}
+ else if (setup.show_undo_redo_buttons)
+ {
+ UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_UNDO);
+ UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PAUSE2);
+ UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_REDO);
+ }
else
{
UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_STOP);
else
{
UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_STOP);
@@
-16180,17
+16190,13
@@
static void UnmapGameButtonsAtSamePosition_All(void)
}
}
}
}
-
static void MapGameButtonsAtSamePosition(int
id)
+
void MapLoadSaveButtons(vo
id)
{
{
- int i;
-
- for (i = 0; i < NUM_GAME_BUTTONS; i++)
- if (i != id &&
- gamebutton_info[i].pos->x == gamebutton_info[id].pos->x &&
- gamebutton_info[i].pos->y == gamebutton_info[id].pos->y)
- MapGadget(game_gadget[i]);
+ UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_LOAD);
+ UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_SAVE);
- UnmapGameButtonsAtSamePosition_All();
+ MapGadget(game_gadget[GAME_CTRL_ID_LOAD]);
+ MapGadget(game_gadget[GAME_CTRL_ID_SAVE]);
}
void MapUndoRedoButtons(void)
}
void MapUndoRedoButtons(void)
@@
-16202,15
+16208,6
@@
void MapUndoRedoButtons(void)
MapGadget(game_gadget[GAME_CTRL_ID_REDO]);
}
MapGadget(game_gadget[GAME_CTRL_ID_REDO]);
}
-void UnmapUndoRedoButtons(void)
-{
- UnmapGadget(game_gadget[GAME_CTRL_ID_UNDO]);
- UnmapGadget(game_gadget[GAME_CTRL_ID_REDO]);
-
- MapGameButtonsAtSamePosition(GAME_CTRL_ID_UNDO);
- MapGameButtonsAtSamePosition(GAME_CTRL_ID_REDO);
-}
-
void ModifyPauseButtons(void)
{
static int ids[] =
void ModifyPauseButtons(void)
{
static int ids[] =
@@
-16232,9
+16229,7
@@
static void MapGameButtonsExt(boolean on_tape)
int i;
for (i = 0; i < NUM_GAME_BUTTONS; i++)
int i;
for (i = 0; i < NUM_GAME_BUTTONS; i++)
- if ((!on_tape || gamebutton_info[i].allowed_on_tape) &&
- i != GAME_CTRL_ID_UNDO &&
- i != GAME_CTRL_ID_REDO)
+ if (!on_tape || gamebutton_info[i].allowed_on_tape)
MapGadget(game_gadget[i]);
UnmapGameButtonsAtSamePosition_All();
MapGadget(game_gadget[i]);
UnmapGameButtonsAtSamePosition_All();
@@
-16326,6
+16321,8
@@
static void GameUndoRedoExt(void)
DrawVideoDisplay(VIDEO_STATE_FRAME_ON, FrameCounter);
DrawVideoDisplay(VIDEO_STATE_1STEP(tape.single_step), 0);
DrawVideoDisplay(VIDEO_STATE_FRAME_ON, FrameCounter);
DrawVideoDisplay(VIDEO_STATE_1STEP(tape.single_step), 0);
+ ModifyPauseButtons();
+
BackToFront();
}
BackToFront();
}