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

This commit is contained in:
zicodxx 2011-01-19 12:21:59 +01:00
parent 493f1cff34
commit 20cf4c5228
3 changed files with 21 additions and 2 deletions

View file

@ -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 <matt1360@gmail.com>; 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
--------

View file

@ -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!!

View file

@ -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.