X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=9c9af0e90144197a94d2253ad0d38d50cb9e9c7d;hb=d621e281cdb7c66130b216b379fd88a45fb82afa;hp=863704ef87709702d125e4d05d2752c9257e2782;hpb=87627cd206d108069804a37f7c7694f672f67479;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 863704ef..9c9af0e9 100644 --- a/src/init.c +++ b/src/init.c @@ -1289,6 +1289,8 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->post_delay_random = 0; g->init_event = ANIM_EVENT_DEFAULT; g->anim_event = ANIM_EVENT_DEFAULT; + g->init_event_action = -1; + g->anim_event_action = -1; g->draw_masked = FALSE; g->draw_order = 0; g->fade_mode = FADE_MODE_DEFAULT; @@ -1511,6 +1513,10 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->init_event = parameter[GFX_ARG_INIT_EVENT]; if (parameter[GFX_ARG_ANIM_EVENT] != ARG_UNDEFINED_VALUE) g->anim_event = parameter[GFX_ARG_ANIM_EVENT]; + if (parameter[GFX_ARG_INIT_EVENT_ACTION] != ARG_UNDEFINED_VALUE) + g->init_event_action = parameter[GFX_ARG_INIT_EVENT_ACTION]; + if (parameter[GFX_ARG_ANIM_EVENT_ACTION] != ARG_UNDEFINED_VALUE) + g->anim_event_action = parameter[GFX_ARG_ANIM_EVENT_ACTION]; /* used for toon animations and global animations */ g->step_offset = parameter[GFX_ARG_STEP_OFFSET]; @@ -5599,27 +5605,32 @@ static void InitArtworkDone() InitGlobalAnimations(); } -void InitNetworkServer() +void InitNetworkSettings() { -#if defined(NETWORK_AVALIABLE) - int nr_wanted; -#endif + InitNetworkInfo(options.network || setup.network_mode, + FALSE, + options.serveronly, + options.server_host, + options.server_port); +} - if (!options.network) +void InitNetworkServer() +{ + if (!network.enabled) return; -#if defined(NETWORK_AVALIABLE) - nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED); + if (!ConnectToServer(network.server_host, network.server_port)) + { + Request("Cannot connect to network server!", REQ_CONFIRM); + + network.enabled = FALSE; - if (!ConnectToServer(options.server_host, options.server_port)) - Error(ERR_EXIT, "cannot connect to network game server"); + return; + } SendToServer_PlayerName(setup.player_name); SendToServer_ProtocolVersion(); - - if (nr_wanted) - SendToServer_NrWanted(nr_wanted); -#endif + SendToServer_NrWanted(setup.network_player_nr + 1); } static boolean CheckArtworkConfigForCustomElements(char *filename) @@ -5992,10 +6003,12 @@ void OpenAll() if (options.execute_command) Execute_Command(options.execute_command); - if (options.serveronly) + InitNetworkSettings(); + + if (network.serveronly) { #if defined(PLATFORM_UNIX) - NetworkServer(options.server_port, options.serveronly); + NetworkServer(network.server_port, TRUE); #else Error(ERR_WARN, "networking only supported in Unix version"); #endif