mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Parties: fix interaction with viewpoint management / spectator mode
- Fixes G_ResetView and G_ResetViews not accounting for parties -- fixes viewpoint switching while in parties. - Fixes spectator controls sometimes activating while in parties.
This commit is contained in:
parent
a0985eb043
commit
62624efcef
2 changed files with 10 additions and 4 deletions
12
src/g_game.c
12
src/g_game.c
|
|
@ -65,6 +65,7 @@
|
||||||
#include "k_podium.h"
|
#include "k_podium.h"
|
||||||
#include "k_rank.h"
|
#include "k_rank.h"
|
||||||
#include "acs/interface.h"
|
#include "acs/interface.h"
|
||||||
|
#include "g_party.h"
|
||||||
|
|
||||||
#ifdef HAVE_DISCORDRPC
|
#ifdef HAVE_DISCORDRPC
|
||||||
#include "discord.h"
|
#include "discord.h"
|
||||||
|
|
@ -1206,7 +1207,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||||
goto aftercmdinput;
|
goto aftercmdinput;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayplayers[forplayer] != g_localplayers[forplayer])
|
if (G_IsPartyLocal(displayplayers[forplayer]) == false)
|
||||||
{
|
{
|
||||||
if (M_MenuButtonPressed(forplayer, MBT_A))
|
if (M_MenuButtonPressed(forplayer, MBT_A))
|
||||||
{
|
{
|
||||||
|
|
@ -2036,8 +2037,13 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive)
|
||||||
/* Check if anyone is available to view. */
|
/* Check if anyone is available to view. */
|
||||||
if (( playernum = G_FindView(playernum, viewnum, onlyactive, playernum < olddisplayplayer) ) == -1)
|
if (( playernum = G_FindView(playernum, viewnum, onlyactive, playernum < olddisplayplayer) ) == -1)
|
||||||
{
|
{
|
||||||
|
if (G_PartySize(consoleplayer) < viewnum)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Fall back on true self */
|
/* Fall back on true self */
|
||||||
playernum = g_localplayers[viewnum-1];
|
playernum = G_PartyMember(consoleplayer, viewnum - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call ViewpointSwitch hooks here.
|
// Call ViewpointSwitch hooks here.
|
||||||
|
|
@ -2112,7 +2118,7 @@ void G_ResetViews(void)
|
||||||
/* Demote splits */
|
/* Demote splits */
|
||||||
if (playersviewable < splits)
|
if (playersviewable < splits)
|
||||||
{
|
{
|
||||||
splits = max(playersviewable, splitscreen + 1); // don't delete local players
|
splits = max(playersviewable, G_PartySize(consoleplayer)); // don't delete local players
|
||||||
r_splitscreen = splits - 1;
|
r_splitscreen = splits - 1;
|
||||||
R_ExecuteSetViewSize();
|
R_ExecuteSetViewSize();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5193,7 +5193,7 @@ void K_drawKartHUD(void)
|
||||||
K_drawMiniPing();
|
K_drawMiniPing();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayplayers[viewnum] != g_localplayers[viewnum] && !demo.playback)
|
if (G_IsPartyLocal(displayplayers[viewnum]) == false && !demo.playback)
|
||||||
{
|
{
|
||||||
K_drawDirectorHUD();
|
K_drawDirectorHUD();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue