projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed 'inline' keyword (compilers are better at this today)
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index eed459776345f33d6bc402864eb4ba6bf1a56c00..894ab64ef8b95af521fc5789b3409e79bf6c7434 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-1993,7
+1993,7
@@
static void InitField(int x, int y, boolean init_game)
CheckTriggeredElementChange(x, y, element, CE_CREATION_OF_X);
}
CheckTriggeredElementChange(x, y, element, CE_CREATION_OF_X);
}
-
inline
static void InitField_WithBug1(int x, int y, boolean init_game)
+static void InitField_WithBug1(int x, int y, boolean init_game)
{
InitField(x, y, init_game);
{
InitField(x, y, init_game);
@@
-2003,7
+2003,7
@@
inline static void InitField_WithBug1(int x, int y, boolean init_game)
InitMovDir(x, y);
}
InitMovDir(x, y);
}
-
inline
static void InitField_WithBug2(int x, int y, boolean init_game)
+static void InitField_WithBug2(int x, int y, boolean init_game)
{
int old_element = Feld[x][y];
{
int old_element = Feld[x][y];
@@
-4809,7
+4809,7
@@
int NewHiScore(int level_nr)
return position;
}
return position;
}
-
inline
static int getElementMoveStepsizeExt(int x, int y, int direction)
+static int getElementMoveStepsizeExt(int x, int y, int direction)
{
int element = Feld[x][y];
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
{
int element = Feld[x][y];
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
@@
-4831,7
+4831,7
@@
inline static int getElementMoveStepsizeExt(int x, int y, int direction)
return step;
}
return step;
}
-
inline
static int getElementMoveStepsize(int x, int y)
+static int getElementMoveStepsize(int x, int y)
{
return getElementMoveStepsizeExt(x, y, MovDir[x][y]);
}
{
return getElementMoveStepsizeExt(x, y, MovDir[x][y]);
}
@@
-6497,7
+6497,7
@@
static void Impact(int x, int y)
PlayLevelSoundElementAction(x, y, element, ACTION_IMPACT);
}
PlayLevelSoundElementAction(x, y, element, ACTION_IMPACT);
}
-
inline
static void TurnRoundExt(int x, int y)
+static void TurnRoundExt(int x, int y)
{
static struct
{
{
static struct
{
@@
-11346,7
+11346,8
@@
static void GameActionsExt(void)
if (game_status != GAME_MODE_PLAYING)
return;
if (game_status != GAME_MODE_PLAYING)
return;
- if (!network_player_action_received)
+ /* check if network player actions still missing and game still running */
+ if (!network_player_action_received && !checkGameEnded())
return; /* failed to get network player actions in time */
/* do not yet reset "network_player_action_received" (for tape.pausing) */
return; /* failed to get network player actions in time */
/* do not yet reset "network_player_action_received" (for tape.pausing) */
@@
-11386,7
+11387,7
@@
static void GameActionsExt(void)
stored_player[i].effective_action = stored_player[i].action;
}
stored_player[i].effective_action = stored_player[i].action;
}
- if (network_playing)
+ if (network_playing
&& !checkGameEnded()
)
SendToServer_MovePlayer(summarized_player_action);
// summarize all actions at local players mapped input device position
SendToServer_MovePlayer(summarized_player_action);
// summarize all actions at local players mapped input device position
@@
-14937,7
+14938,10
@@
void RequestRestartGame(char *message)
{
game.restart_game_message = NULL;
{
game.restart_game_message = NULL;
- if (Request(message, REQ_ASK | REQ_STAY_CLOSED))
+ boolean has_started_game = hasStartedNetworkGame();
+ int request_mode = (has_started_game ? REQ_ASK : REQ_CONFIRM);
+
+ if (Request(message, request_mode | REQ_STAY_CLOSED) && has_started_game)
{
StartGameActions(network.enabled, setup.autorecord, level.random_seed);
}
{
StartGameActions(network.enabled, setup.autorecord, level.random_seed);
}
@@
-14976,7
+14980,9
@@
void CheckGameOver(void)
}
if (last_game_over != game_over)
}
if (last_game_over != game_over)
- game.restart_game_message = "Game over! Play it again?";
+ game.restart_game_message = (hasStartedNetworkGame() ?
+ "Game over! Play it again?" :
+ "Game over!");
last_game_over = game_over;
}
last_game_over = game_over;
}