From: Holger Schemel Date: Tue, 13 Oct 1998 08:03:48 +0000 (+0200) Subject: rnd-19981013-1 X-Git-Tag: 1.2.0^2~59 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=59c2e609872b70cb4c458004cd9e2fe22c86a54b;p=rocksndiamonds.git rnd-19981013-1 --- 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