From 59c2e609872b70cb4c458004cd9e2fe22c86a54b Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 13 Oct 1998 10:03:48 +0200 Subject: [PATCH] rnd-19981013-1 --- src/editor.c | 19 +++++++------- src/events.c | 3 ++- src/game.c | 17 +++++++------ src/init.c | 2 +- src/main.c | 2 +- src/main.h | 2 +- src/misc.c | 2 +- src/network.c | 7 ++---- src/screens.c | 69 ++++++++++++++++++++++++++++++++------------------- src/tape.c | 2 +- src/tools.c | 4 +-- 11 files changed, 74 insertions(+), 55 deletions(-) diff --git a/src/editor.c b/src/editor.c index 85ae127e..6ec17e91 100644 --- a/src/editor.c +++ b/src/editor.c @@ -610,24 +610,25 @@ void FloodFill(int from_x, int from_y, int fill_element) static int check[4][2] = { {-1,0}, {0,-1}, {1,0}, {0,1} }; static int safety = 0; + /* check if starting field still has the desired content */ + if (Feld[from_x][from_y] == fill_element) + return; + safety++; - if (safety>lev_fieldx*lev_fieldy) - { - fprintf(stderr,"Something went wrong in 'FloodFill()'. Please debug.\n"); - exit(-1); - } + if (safety > lev_fieldx*lev_fieldy) + Error(ERR_EXIT, "Something went wrong in 'FloodFill()'. Please debug."); old_element = Feld[from_x][from_y]; Feld[from_x][from_y] = fill_element; for(i=0;i<4;i++) { - x = from_x+check[i][0]; - y = from_y+check[i][1]; + x = from_x + check[i][0]; + y = from_y + check[i][1]; - if (IN_LEV_FIELD(x,y) && Feld[x][y]==old_element) - FloodFill(x,y,fill_element); + if (IN_LEV_FIELD(x,y) && Feld[x][y] == old_element) + FloodFill(x, y, fill_element); } safety--; diff --git a/src/events.c b/src/events.c index 92bdeef6..088650b1 100644 --- a/src/events.c +++ b/src/events.c @@ -726,7 +726,8 @@ void HandleNoXEvent() return; } - HandleNetworking(); + if (network) + HandleNetworking(); switch(game_status) { diff --git a/src/game.c b/src/game.c index f6e226bc..354c823b 100644 --- a/src/game.c +++ b/src/game.c @@ -134,7 +134,8 @@ void InitGame() /* initial null action */ - SendToServer_MovePlayer(MV_NO_MOVING); + if (network) + SendToServer_MovePlayer(MV_NO_MOVING); @@ -2888,7 +2889,7 @@ void GameActions(byte player_action) /* main game synchronization point */ WaitUntilDelayReached(&action_delay, action_delay_value); - if (!standalone && !network_player_action_received) + if (network && !network_player_action_received) { /* #ifdef DEBUG @@ -2925,13 +2926,13 @@ void GameActions(byte player_action) else recorded_player_action = NULL; - if (!standalone) + if (network) SendToServer_MovePlayer(player_action); for(i=0; i