From 20cf4c5228e3a9e2fef085a3a9347c9d41ee3c80 Mon Sep 17 00:00:00 2001 From: zicodxx Date: Wed, 19 Jan 2011 12:21:59 +0100 Subject: [PATCH] Fix for showing bounty target in kill list - was not actually checking if player_num == Bounty_target; When Bounty_target player leaves game host must select a new target so the game can proceed; Made Bounty sound play a bit louder --- CHANGELOG.txt | 1 + main/gauges.c | 2 +- main/multi.c | 20 +++++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8dd444242..1e66c2ffa 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D1X-Rebirth Changelog 20110119 -------- include/3d.h, main/game.h, main/gamerend.c, main/gauges.c, main/multi.c, main/multi.h, main/net_udp.c: Introducing new BOUNTY Multiplayer game mode by Matt "1360" Vandermeulen ; Fit show_HUD_names code to be more similar to D2X - names display still client-decided tho +main/gauges.c, main/multi.c: Fix for showing bounty target in kill list - was not actually checking if player_num == Bounty_target; When Bounty_target player leaves game host must select a new target so the game can proceed; Made Bounty sound play a bit louder 20110118 -------- diff --git a/main/gauges.c b/main/gauges.c index 0d7706491..cdedbdc11 100644 --- a/main/gauges.c +++ b/main/gauges.c @@ -2198,7 +2198,7 @@ void hud_show_kill_list() if (Show_kill_list == 3) strcpy(name, Netgame.team_name[i]); - else if (Game_mode & GM_BOUNTY && GameTime64&0x10000) + else if (Game_mode & GM_BOUNTY && player_num == Bounty_target && GameTime64&0x10000) strcpy(name,"[TARGET]"); else strcpy(name,Players[player_num].callsign); // Note link to above if!! diff --git a/main/multi.c b/main/multi.c index 5689e4d9f..39898a732 100644 --- a/main/multi.c +++ b/main/multi.c @@ -1742,6 +1742,24 @@ multi_do_quit(char *buf) { HUD_init_message(HM_MULTI, "You are the only person remaining in this netgame"); } + + // Bounty target left - select a new one + if( Game_mode & GM_BOUNTY && buf[1] == Bounty_target && multi_i_am_master() ) + { + /* Select a random number */ + int new_bounty_target = d_rand() % MAX_NUM_NET_PLAYERS; + + /* Make sure they're valid: Don't check against kill flags, + * just in case everyone's dead! */ + while( !Players[new_bounty_target].connected ) + new_bounty_target = d_rand() % MAX_NUM_NET_PLAYERS; + + /* Select new target */ + multi_new_bounty_target( new_bounty_target ); + + /* Send this new data */ + multi_send_bounty(); + } } return; @@ -3315,7 +3333,7 @@ void multi_new_bounty_target( int pnum ) BM_XRGB( player_rgb[Bounty_target].r, player_rgb[Bounty_target].g, player_rgb[Bounty_target].b ), Players[Bounty_target].callsign ); - digi_play_sample( SOUND_CONTROL_CENTER_WARNING_SIREN, F1_0 * 2 ); + digi_play_sample( SOUND_CONTROL_CENTER_WARNING_SIREN, F1_0 * 3 ); } // Following functions convert object to object_rw and back. Mainly this is used for IPX backwards compability. However also for UDP this makes sense as object differs from object_rw mainly between fix/fix64-based timers. Those base on GameTime64 which is never synced between players so we set the times to something sane the clients can safely handle. IF object some day contains something useful clients should know about this should be changed.