mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Merge branch 'build-bot-party' into 'master'
Fix some failed assertions for G_LeaveParty See merge request KartKrew/Kart!1243
This commit is contained in:
commit
65511d6fdc
3 changed files with 13 additions and 3 deletions
|
|
@ -2794,7 +2794,6 @@ void CL_ClearPlayer(INT32 playernum)
|
||||||
splitscreen_invitations[playernum] = -1;
|
splitscreen_invitations[playernum] = -1;
|
||||||
|
|
||||||
playerconsole[playernum] = playernum;
|
playerconsole[playernum] = playernum;
|
||||||
G_DestroyParty(playernum);
|
|
||||||
|
|
||||||
// Wipe the struct.
|
// Wipe the struct.
|
||||||
memset(&players[playernum], 0, sizeof (player_t));
|
memset(&players[playernum], 0, sizeof (player_t));
|
||||||
|
|
@ -3876,6 +3875,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||||
{
|
{
|
||||||
// Clear player before joining, lest some things get set incorrectly
|
// Clear player before joining, lest some things get set incorrectly
|
||||||
CL_ClearPlayer(newplayernum);
|
CL_ClearPlayer(newplayernum);
|
||||||
|
G_DestroyParty(newplayernum);
|
||||||
|
|
||||||
playeringame[newplayernum] = true;
|
playeringame[newplayernum] = true;
|
||||||
G_AddPlayer(newplayernum);
|
G_AddPlayer(newplayernum);
|
||||||
|
|
@ -4018,6 +4018,7 @@ static void Got_AddBot(UINT8 **p, INT32 playernum)
|
||||||
|
|
||||||
// Clear player before joining, lest some things get set incorrectly
|
// Clear player before joining, lest some things get set incorrectly
|
||||||
CL_ClearPlayer(newplayernum);
|
CL_ClearPlayer(newplayernum);
|
||||||
|
G_DestroyParty(newplayernum);
|
||||||
|
|
||||||
playeringame[newplayernum] = true;
|
playeringame[newplayernum] = true;
|
||||||
G_AddPlayer(newplayernum);
|
G_AddPlayer(newplayernum);
|
||||||
|
|
@ -4038,6 +4039,9 @@ static void Got_AddBot(UINT8 **p, INT32 playernum)
|
||||||
sprintf(player_names[newplayernum], "%s", skins[skinnum].realname);
|
sprintf(player_names[newplayernum], "%s", skins[skinnum].realname);
|
||||||
SetPlayerSkinByNum(newplayernum, skinnum);
|
SetPlayerSkinByNum(newplayernum, skinnum);
|
||||||
|
|
||||||
|
playerconsole[newplayernum] = newplayernum;
|
||||||
|
G_BuildLocalSplitscreenParty(newplayernum);
|
||||||
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
{
|
{
|
||||||
HU_AddChatText(va("\x82*Bot %d has been added to the game", newplayernum+1), false);
|
HU_AddChatText(va("\x82*Bot %d has been added to the game", newplayernum+1), false);
|
||||||
|
|
@ -7108,4 +7112,4 @@ void SendServerNotice(SINT8 target, char *message)
|
||||||
if (client)
|
if (client)
|
||||||
return;
|
return;
|
||||||
DoSayCommand(message, target + 1, HU_PRIVNOTICE, servernode);
|
DoSayCommand(message, target + 1, HU_PRIVNOTICE, servernode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,11 @@ public:
|
||||||
// consoleplayer.
|
// consoleplayer.
|
||||||
Party& operator [](Party::Console console) { return pool_[console]; }
|
Party& operator [](Party::Console console) { return pool_[console]; }
|
||||||
|
|
||||||
|
// Clears a single player's local party. This method
|
||||||
|
// accesses the playernum directly, instead of the
|
||||||
|
// consoleplayer.
|
||||||
|
void reset(playernum_t player) { pool_[player] = {}; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::array<Party, MAXPLAYERS> pool_;
|
std::array<Party, MAXPLAYERS> pool_;
|
||||||
}
|
}
|
||||||
|
|
@ -271,7 +276,7 @@ void G_ObliterateParties(void)
|
||||||
|
|
||||||
void G_DestroyParty(UINT8 player)
|
void G_DestroyParty(UINT8 player)
|
||||||
{
|
{
|
||||||
local_party[player] = {};
|
local_party.reset(player);
|
||||||
final_party[player] = {};
|
final_party[player] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -944,6 +944,7 @@ static void P_NetUnArchiveParties(savebuffer_t *save)
|
||||||
if (!playeringame[i])
|
if (!playeringame[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
G_DestroyParty(i);
|
||||||
G_BuildLocalSplitscreenParty(i);
|
G_BuildLocalSplitscreenParty(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue