X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Fsynchro_1.c;h=5f0929875b67b59ca711d4c89839cfd2da4eec6d;hb=36b674d2aef8799197255218ef893857f49cff18;hp=38607713370c2cf3e6e136aefc48e8dabd85d2ae;hpb=1fcb3ddbb8404effdcfa5ebbd53d3ff5009260f6;p=rocksndiamonds.git diff --git a/src/game_em/synchro_1.c b/src/game_em/synchro_1.c index 38607713..5f092987 100644 --- a/src/game_em/synchro_1.c +++ b/src/game_em/synchro_1.c @@ -12,6 +12,8 @@ extern int centered_player_nr; #endif +#define USE_CHANGED_ACID_STUFF 1 + extern boolean checkIfAllPlayersFitToScreen(); static void check_player(struct PLAYER *); @@ -421,7 +423,7 @@ static void kill_player(struct PLAYER *ply) switch(Cave[y][x]) { -#if 1 +#if USE_CHANGED_ACID_STUFF case Xacid_1: case Xacid_2: case Xacid_3: @@ -548,13 +550,26 @@ static void check_player(struct PLAYER *ply) int oldy = ply->y; int x = oldx + dx; int y = oldy + dy; - boolean can_move = TRUE; + boolean players_visible_before_move; + boolean players_visible_after_move; + boolean can_move; + + players_visible_before_move = checkIfAllPlayersFitToScreen(); ply->x = x; ply->y = y; + players_visible_after_move = checkIfAllPlayersFitToScreen(); + + /* + player is allowed to move only in the following cases: + - it is not needed to display all players (not focussed to all players) + - all players are (still or again) visible after the move + - some players were already outside visible screen area before the move + */ can_move = (game.centered_player_nr != -1 || - checkIfAllPlayersFitToScreen()); + players_visible_after_move || + !players_visible_before_move); ply->x = oldx; ply->y = oldy; @@ -671,7 +686,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) ply->y = y; break; -#if 1 +#if USE_CHANGED_ACID_STUFF case Xacid_1: case Xacid_2: case Xacid_3: @@ -680,12 +695,12 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xacid_6: case Xacid_7: case Xacid_8: -#endif if (Cave[y-1][x+1] == Xblank) Cave[y-1][x+1] = Yacid_splash_eB; if (Cave[y-1][x-1] == Xblank) Cave[y-1][x-1] = Yacid_splash_wB; play_element_sound(x, y, SAMPLE_acid, Xacid_1); +#endif case Xboom_android: case Xboom_1: @@ -705,7 +720,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xtank_goe: case Xtank_gos: case Xtank_gow: -#if 0 + +#if !USE_CHANGED_ACID_STUFF case Xacid_1: case Xacid_2: case Xacid_3: