if (game.use_block_last_field_bug)
player->block_delay_adjustment = (player->block_last_field ? -1 : 1);
- if (!options.network || player->connected_network)
+ if (!network.enabled || player->connected_network)
{
player->active = TRUE;
InitGameControlValues();
/* don't play tapes over network */
- network_playing = (options.network && !tape.playing);
+ network_playing = (network.enabled && !tape.playing);
for (i = 0; i < MAX_PLAYERS; i++)
{
game.envelope_active = FALSE;
- /* set focus to local player for network games, else to all players */
- game.centered_player_nr = (network_playing ? local_player->index_nr : -1);
- game.centered_player_nr_next = game.centered_player_nr;
- game.set_centered_player = FALSE;
-
- if (network_playing && tape.recording)
- {
- /* store client dependent player focus when recording network games */
- tape.centered_player_nr_next = game.centered_player_nr_next;
- tape.set_centered_player = TRUE;
- }
-
for (i = 0; i < NUM_BELTS; i++)
{
game.belt_dir[i] = MV_NONE;
if (options.debug)
{
printf("Player status at level initialization:\n");
+
+ for (i = 0; i < MAX_PLAYERS; i++)
+ {
+ struct PlayerInfo *player = &stored_player[i];
+
+ printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
+ i + 1,
+ player->present,
+ player->connected,
+ player->connected_locally,
+ player->connected_network,
+ player->active);
+
+ if (local_player == player)
+ printf(" (local player)");
+
+ printf("\n");
+ }
}
#endif
local_player = &stored_player[i];
}
- if (!options.network)
+ if (!network.enabled)
local_player->connected = TRUE;
if (tape.playing)
for (i = 0; i < MAX_PLAYERS; i++)
stored_player[i].connected = tape.player_participates[i];
}
- else if (options.network)
+ else if (network.enabled)
{
/* add team mode players connected over the network (needed for correct
assignment of player figures from level to locally playing players) */
{
struct PlayerInfo *player = &stored_player[i];
- printf("- player %d: present == %d, connected == %d, active == %d",
+ printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
i + 1,
player->present,
player->connected,
+ player->connected_locally,
+ player->connected_network,
player->active);
if (local_player == player)
{
struct PlayerInfo *player = &stored_player[i];
- printf("- player %d: present == %d, connected == %d, active == %d",
+ printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
i + 1,
player->present,
player->connected,
+ player->connected_locally,
+ player->connected_network,
player->active);
if (local_player == player)
printf("::: local_player->present == %d\n", local_player->present);
#endif
+ /* set focus to local player for network games, else to all players */
+ game.centered_player_nr = (network_playing ? local_player->index_nr : -1);
+ game.centered_player_nr_next = game.centered_player_nr;
+ game.set_centered_player = FALSE;
+
+ if (network_playing && tape.recording)
+ {
+ /* store client dependent player focus when recording network games */
+ tape.centered_player_nr_next = game.centered_player_nr_next;
+ tape.set_centered_player = TRUE;
+ }
+
if (tape.playing)
{
/* when playing a tape, eliminate all players who do not participate */
}
#endif
}
- else if (!options.network && !game.team_mode) /* && !tape.playing */
+ else if (!network.enabled && !game.team_mode) /* && !tape.playing */
{
/* when in single player mode, eliminate all but the first active player */
{
struct PlayerInfo *player = &stored_player[i];
- printf("- player %d: present == %d, connected == %d, active == %d",
+ printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
i + 1,
player->present,
player->connected,
+ player->connected_locally,
+ player->connected_network,
player->active);
if (local_player == player)
{
struct PlayerInfo *player = &stored_player[i];
- printf("- player %d: present == %d, connected == %d, active == %d",
+ printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
i + 1,
player->present,
player->connected,
+ player->connected_locally,
+ player->connected_network,
player->active);
if (local_player == player)
}
if (game.restart_level)
- StartGameActions(options.network, setup.autorecord, level.random_seed);
+ StartGameActions(network.enabled, setup.autorecord, level.random_seed);
/* !!! SAME CODE AS IN "CheckLevelTime()" -- FIX THIS !!! */
if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
// summarize all actions at local players mapped input device position
// (this allows using different input devices in single player mode)
- if (!options.network && !game.team_mode)
+ if (!network.enabled && !game.team_mode)
stored_player[map_player_action[local_player->index_nr]].effective_action =
summarized_player_action;
}
}
- if (!options.network && game.centered_player_nr == -1 &&
+ if (!network.enabled && game.centered_player_nr == -1 &&
!AllPlayersInSight(player, new_jx, new_jy))
return MP_NO_ACTION;
if (scroll_x != old_scroll_x || scroll_y != old_scroll_y)
{
- if (!options.network && game.centered_player_nr == -1 &&
+ if (!network.enabled && game.centered_player_nr == -1 &&
!AllPlayersInVisibleScreen())
{
scroll_x = old_scroll_x;
CloseDoor(DOOR_CLOSE_1);
#if defined(NETWORK_AVALIABLE)
- if (options.network)
+ if (network.enabled)
SendToServer_StopPlaying(NETWORK_STOP_BY_PLAYER);
else
#endif
if (Request(message, REQ_ASK | REQ_STAY_CLOSED))
{
- StartGameActions(options.network, setup.autorecord, level.random_seed);
+ StartGameActions(network.enabled, setup.autorecord, level.random_seed);
}
else
{
for (i = 0; i < NUM_GAME_BUTTONS; i++)
{
- struct GraphicInfo *gfx = &graphic_info[gamebutton_info[i].graphic];
+ int graphic = gamebutton_info[i].graphic;
+ struct GraphicInfo *gfx = &graphic_info[graphic];
struct XY *pos = gamebutton_info[i].pos;
struct GadgetInfo *gi;
int button_type;
}
gi = CreateGadget(GDI_CUSTOM_ID, id,
+ GDI_IMAGE_ID, graphic,
GDI_INFO_TEXT, gamebutton_info[i].infotext,
GDI_X, base_x + GDI_ACTIVE_POS(pos->x),
GDI_Y, base_y + GDI_ACTIVE_POS(pos->y),
case GAME_CTRL_ID_PAUSE:
case GAME_CTRL_ID_PAUSE2:
case GAME_CTRL_ID_PANEL_PAUSE:
- if (options.network && game_status == GAME_MODE_PLAYING)
+ if (network.enabled && game_status == GAME_MODE_PLAYING)
{
#if defined(NETWORK_AVALIABLE)
if (tape.pausing)
case GAME_CTRL_ID_PANEL_PLAY:
if (game_status == GAME_MODE_MAIN)
{
- StartGameActions(options.network, setup.autorecord, level.random_seed);
+ StartGameActions(network.enabled, setup.autorecord, level.random_seed);
}
else if (tape.pausing)
{
#if defined(NETWORK_AVALIABLE)
- if (options.network)
+ if (network.enabled)
SendToServer_ContinuePlaying();
else
#endif