mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
For fun, let the bots vote
This commit is contained in:
parent
425220a109
commit
2e963a46f5
3 changed files with 22 additions and 8 deletions
|
|
@ -2801,11 +2801,10 @@ void D_SetupVote(void)
|
|||
SendNetXCmd(XD_SETUPVOTE, buf, p - buf);
|
||||
}
|
||||
|
||||
void D_ModifyClientVote(SINT8 voted, UINT8 splitplayer)
|
||||
void D_ModifyClientVote(UINT8 player, SINT8 voted, UINT8 splitplayer)
|
||||
{
|
||||
char buf[2];
|
||||
char *p = buf;
|
||||
UINT8 player = consoleplayer;
|
||||
|
||||
if (splitplayer > 0)
|
||||
player = g_localplayers[splitplayer];
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ void Command_Retry_f(void);
|
|||
void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore
|
||||
void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pencoremode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect);
|
||||
void D_SetupVote(void);
|
||||
void D_ModifyClientVote(SINT8 voted, UINT8 splitplayer);
|
||||
void D_ModifyClientVote(UINT8 player, SINT8 voted, UINT8 splitplayer);
|
||||
void D_PickVote(void);
|
||||
void ObjectPlace_OnChange(void);
|
||||
boolean IsPlayerAdmin(INT32 playernum);
|
||||
|
|
|
|||
|
|
@ -1507,6 +1507,7 @@ static void Y_VoteStops(SINT8 pick, SINT8 level)
|
|||
void Y_VoteTicker(void)
|
||||
{
|
||||
INT32 i;
|
||||
boolean everyone_voted;
|
||||
|
||||
if (paused || P_AutoPause() || !voteclient.loaded)
|
||||
return;
|
||||
|
|
@ -1655,7 +1656,7 @@ void Y_VoteTicker(void)
|
|||
|
||||
if ((InputDown(gc_accelerate, i+1) || JoyAxis(AXISMOVE, i+1) > 0) && !pressed)
|
||||
{
|
||||
D_ModifyClientVote(voteclient.playerinfo[i].selection, i);
|
||||
D_ModifyClientVote(consoleplayer, voteclient.playerinfo[i].selection, i);
|
||||
pressed = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1669,6 +1670,8 @@ void Y_VoteTicker(void)
|
|||
|
||||
if (server)
|
||||
{
|
||||
everyone_voted = true;/* the default condition */
|
||||
|
||||
if (timer == 0)
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
|
|
@ -1682,13 +1685,25 @@ void Y_VoteTicker(void)
|
|||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if ((playeringame[i] && !players[i].spectator) && votes[i] == -1)
|
||||
return;
|
||||
{
|
||||
if (players[i].bot)
|
||||
{
|
||||
if (( M_RandomFixed() % 100 ) == 0)
|
||||
D_ModifyClientVote(i, M_RandomKey(4), 0);
|
||||
}
|
||||
|
||||
if (votes[i] == -1)
|
||||
everyone_voted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
timer = 0;
|
||||
if (voteendtic == -1)
|
||||
D_PickVote();
|
||||
if (everyone_voted)
|
||||
{
|
||||
timer = 0;
|
||||
if (voteendtic == -1)
|
||||
D_PickVote();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue