When restoring Coop setting from netgame profile don't forget to fix max players variable

This commit is contained in:
zicodxx 2011-05-22 20:04:43 +02:00
parent 23197f52e5
commit bdeb0a70b4
2 changed files with 5 additions and 2 deletions

View file

@ -3,6 +3,7 @@ D2X-Rebirth Changelog
20110522
--------
editor/med.c, main/game.c, main/gameseg.c, main/gameseq.c, main/menu.c: Like in BigEndian builds do netmisc_calc_checksum() only with expected items of segment/side struct to prevent different checksums in case these structs change; Fixed several issues when building with editor; Fixed compiler warning regarding set but unused variable
main/net_udp.c: When restoring Coop setting from netgame profile don't forget to fix max players variable
20110520
--------

View file

@ -3270,12 +3270,11 @@ int net_udp_setup_game()
if (i!=Player_num)
Players[i].callsign[0]=0;
MaxNumNetPlayers = MAX_NUM_NET_PLAYERS;
Netgame.max_numplayers = MaxNumNetPlayers = MAX_NUM_NET_PLAYERS;
Netgame.KillGoal=0;
Netgame.PlayTimeAllowed=0;
Netgame.Allow_marker_view=1;
Netgame.difficulty=PlayerCfg.DefaultDifficulty;
Netgame.max_numplayers=MaxNumNetPlayers;
sprintf( Netgame.game_name, "%s%s", Players[Player_num].callsign, TXT_S_GAME );
if (GameArg.MplUdpMyPort != 0)
snprintf (UDP_MyPort, sizeof(UDP_MyPort), "%d", GameArg.MplUdpMyPort);
@ -3293,6 +3292,9 @@ int net_udp_setup_game()
read_netgame_profile(&Netgame);
if (Netgame.gamemode == NETGAME_COOPERATIVE) // did we resotred Coop as default? then fix max players right now!
Netgame.max_numplayers = MaxNumNetPlayers = 4;
strcpy(Netgame.mission_name, Current_mission_filename);
strcpy(Netgame.mission_title, Current_mission_longname);