Merge remote-tracking branch 'refs/remotes/origin/sal-misc'
This commit is contained in:
commit
68ce3334ca
59
src/g_game.c
59
src/g_game.c
|
@ -2611,7 +2611,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
|
||||||
{
|
{
|
||||||
if (!(spawnpoint = G_FindCTFStart(playernum)) // find a CTF start
|
if (!(spawnpoint = G_FindCTFStart(playernum)) // find a CTF start
|
||||||
&& !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start
|
&& !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start
|
||||||
spawnpoint = G_FindCoopStart(playernum); // fallback
|
spawnpoint = G_FindRaceStart(playernum); // fallback
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- DM/Tag/CTF-spectator/etc --
|
// -- DM/Tag/CTF-spectator/etc --
|
||||||
|
@ -2621,14 +2621,14 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
|
||||||
{
|
{
|
||||||
if (!(spawnpoint = G_FindMatchStart(playernum)) // find a DM start
|
if (!(spawnpoint = G_FindMatchStart(playernum)) // find a DM start
|
||||||
&& !(spawnpoint = G_FindCTFStart(playernum))) // find a CTF start
|
&& !(spawnpoint = G_FindCTFStart(playernum))) // find a CTF start
|
||||||
spawnpoint = G_FindCoopStart(playernum); // fallback
|
spawnpoint = G_FindRaceStart(playernum); // fallback
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- Other game modes --
|
// -- Other game modes --
|
||||||
// Order: Coop->DM->CTF
|
// Order: Coop->DM->CTF
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(spawnpoint = G_FindCoopStart(playernum)) // find a Co-op start
|
if (!(spawnpoint = G_FindRaceStart(playernum)) // find a Race start
|
||||||
&& !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start
|
&& !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start
|
||||||
spawnpoint = G_FindCTFStart(playernum); // fallback
|
spawnpoint = G_FindCTFStart(playernum); // fallback
|
||||||
}
|
}
|
||||||
|
@ -2760,24 +2760,65 @@ mapthing_t *G_FindMatchStart(INT32 playernum)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mapthing_t *G_FindCoopStart(INT32 playernum)
|
mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||||
{
|
{
|
||||||
if (numcoopstarts)
|
if (numcoopstarts)
|
||||||
{
|
{
|
||||||
//if there's 6 players in a map with 3 player starts, this spawns them 1/2/3/1/2/3.
|
INT32 i, pos = 0;
|
||||||
|
|
||||||
|
// SRB2Kart: figure out player spawn pos from points
|
||||||
|
if (!playeringame[playernum] || players[playernum].spectator)
|
||||||
|
return playerstarts[0]; // go to first spot if you're a spectator
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (i == playernum)
|
||||||
|
continue;
|
||||||
|
if (!playeringame[i] || players[i].spectator)
|
||||||
|
continue;
|
||||||
|
if (players[i].score > players[playernum].score)
|
||||||
|
pos++;
|
||||||
|
if (i != 0)
|
||||||
|
{
|
||||||
|
INT32 j;
|
||||||
|
for (j = 0; j < i; j++) // I don't like loops in loops, but is needed to resolve ties :<
|
||||||
|
{
|
||||||
|
if (i == j)
|
||||||
|
continue;
|
||||||
|
if (!playeringame[j] || players[j].spectator)
|
||||||
|
continue;
|
||||||
|
if (players[i].score == players[j].score)
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (G_CheckSpot(playernum, playerstarts[pos % numcoopstarts]))
|
||||||
|
return playerstarts[pos % numcoopstarts];
|
||||||
|
|
||||||
|
// Your spot isn't available? Go for the old behavior
|
||||||
|
// if there's 6 players in a map with 3 player starts, this spawns them 1/2/3/1/2/3.
|
||||||
if (G_CheckSpot(playernum, playerstarts[playernum % numcoopstarts]))
|
if (G_CheckSpot(playernum, playerstarts[playernum % numcoopstarts]))
|
||||||
return playerstarts[playernum % numcoopstarts];
|
return playerstarts[playernum % numcoopstarts];
|
||||||
|
|
||||||
//Don't bother checking to see if the player 1 start is open.
|
// SRB2Kart: We have solid players, so this behavior is less ideal.
|
||||||
//Just spawn there.
|
// Don't bother checking to see if the player 1 start is open.
|
||||||
return playerstarts[0];
|
// Just spawn there.
|
||||||
|
//return playerstarts[0];
|
||||||
|
|
||||||
|
if (playernum == consoleplayer
|
||||||
|
|| (splitscreen && playernum == secondarydisplayplayer)
|
||||||
|
|| (splitscreen > 1 && playernum == thirddisplayplayer)
|
||||||
|
|| (splitscreen > 2 && playernum == fourthdisplayplayer))
|
||||||
|
CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Race starts!\n"));
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playernum == consoleplayer
|
if (playernum == consoleplayer
|
||||||
|| (splitscreen && playernum == secondarydisplayplayer)
|
|| (splitscreen && playernum == secondarydisplayplayer)
|
||||||
|| (splitscreen > 1 && playernum == thirddisplayplayer)
|
|| (splitscreen > 1 && playernum == thirddisplayplayer)
|
||||||
|| (splitscreen > 2 && playernum == fourthdisplayplayer))
|
|| (splitscreen > 2 && playernum == fourthdisplayplayer))
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("No Co-op starts in this map!\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("No Race starts in this map!\n"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ char *G_BuildMapTitle(INT32 mapnum);
|
||||||
// XMOD spawning
|
// XMOD spawning
|
||||||
mapthing_t *G_FindCTFStart(INT32 playernum);
|
mapthing_t *G_FindCTFStart(INT32 playernum);
|
||||||
mapthing_t *G_FindMatchStart(INT32 playernum);
|
mapthing_t *G_FindMatchStart(INT32 playernum);
|
||||||
mapthing_t *G_FindCoopStart(INT32 playernum);
|
mapthing_t *G_FindRaceStart(INT32 playernum);
|
||||||
void G_SpawnPlayer(INT32 playernum, boolean starpost);
|
void G_SpawnPlayer(INT32 playernum, boolean starpost);
|
||||||
|
|
||||||
// Can be called by the startup code or M_Responder.
|
// Can be called by the startup code or M_Responder.
|
||||||
|
|
16
src/k_kart.c
16
src/k_kart.c
|
@ -1190,21 +1190,7 @@ void K_KartPlayerAfterThink(player_t *player)
|
||||||
|
|
||||||
static void K_PlayTauntSound(mobj_t *source)
|
static void K_PlayTauntSound(mobj_t *source)
|
||||||
{
|
{
|
||||||
switch (P_RandomFixed() % 4)
|
S_StartSound(source, sfx_taunt1+P_RandomKey(4));
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
S_StartSound(source, sfx_taunt1);
|
|
||||||
return;
|
|
||||||
case 1:
|
|
||||||
S_StartSound(source, sfx_taunt2);
|
|
||||||
return;
|
|
||||||
case 2:
|
|
||||||
S_StartSound(source, sfx_taunt3);
|
|
||||||
return;
|
|
||||||
case 3:
|
|
||||||
S_StartSound(source, sfx_taunt4);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void K_MomentumToFacing(player_t *player)
|
void K_MomentumToFacing(player_t *player)
|
||||||
|
|
|
@ -2188,7 +2188,7 @@ void Y_VoteDrawer(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
x = 20;
|
x = 20;
|
||||||
y = 15;
|
y = 10;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
@ -2226,10 +2226,10 @@ void Y_VoteDrawer(void)
|
||||||
|
|
||||||
y += 30;
|
y += 30;
|
||||||
|
|
||||||
if (y > BASEVIDHEIGHT-38)
|
if (y > BASEVIDHEIGHT-40)
|
||||||
{
|
{
|
||||||
x += 100;
|
x += 60;
|
||||||
y = 15;
|
y = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2367,6 +2367,16 @@ void Y_VoteTicker(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
|
{
|
||||||
|
if (timer == 0)
|
||||||
|
{
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if ((playeringame[i] && !players[i].spectator) && votes[i] == -1 && !splitscreen)
|
||||||
|
votes[i] = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (splitscreen)
|
if (splitscreen)
|
||||||
{
|
{
|
||||||
|
@ -2381,6 +2391,7 @@ void Y_VoteTicker(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
timer = 0;
|
timer = 0;
|
||||||
if (voteendtic == -1)
|
if (voteendtic == -1)
|
||||||
|
@ -2509,7 +2520,7 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if ((playeringame[i] && !players[i].spectator) && votes[i] == -1)
|
if ((playeringame[i] && !players[i].spectator) && votes[i] == -1 && !splitscreen)
|
||||||
votes[i] = 3;
|
votes[i] = 3;
|
||||||
|
|
||||||
if (votes[i] == -1)
|
if (votes[i] == -1)
|
||||||
|
|
Loading…
Reference in a new issue