mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-09 11:21:24 +00:00
Fix splitscreen, offline and death
This commit is contained in:
parent
ab95b45e38
commit
1967ee2dd5
3 changed files with 27 additions and 8 deletions
|
@ -1317,6 +1317,10 @@ static void SendNameAndColor(void)
|
||||||
if (players[consoleplayer].mo)
|
if (players[consoleplayer].mo)
|
||||||
players[consoleplayer].mo->color = players[consoleplayer].skincolor;
|
players[consoleplayer].mo->color = players[consoleplayer].skincolor;
|
||||||
|
|
||||||
|
// Update follower for local games:
|
||||||
|
if (cv_follower.value >= 0 && cv_follower.value != players[consoleplayer].followerskin)
|
||||||
|
SetFollower(consoleplayer, cv_follower.value);
|
||||||
|
|
||||||
if (metalrecording)
|
if (metalrecording)
|
||||||
{ // Metal Sonic is Sonic, obviously.
|
{ // Metal Sonic is Sonic, obviously.
|
||||||
SetPlayerSkinByNum(consoleplayer, 0);
|
SetPlayerSkinByNum(consoleplayer, 0);
|
||||||
|
@ -1453,6 +1457,10 @@ static void SendNameAndColor2(void)
|
||||||
if (players[secondplaya].mo)
|
if (players[secondplaya].mo)
|
||||||
players[secondplaya].mo->color = players[secondplaya].skincolor;
|
players[secondplaya].mo->color = players[secondplaya].skincolor;
|
||||||
|
|
||||||
|
// Update follower for local games:
|
||||||
|
if (cv_follower2.value >= 0 && cv_follower2.value != players[secondplaya].followerskin)
|
||||||
|
SetFollower(secondplaya, cv_follower2.value);
|
||||||
|
|
||||||
if ((foundskin = R_SkinAvailable(cv_skin2.string)) != -1)
|
if ((foundskin = R_SkinAvailable(cv_skin2.string)) != -1)
|
||||||
{
|
{
|
||||||
//boolean notsame;
|
//boolean notsame;
|
||||||
|
@ -1573,6 +1581,10 @@ static void SendNameAndColor3(void)
|
||||||
if (players[thirdplaya].mo)
|
if (players[thirdplaya].mo)
|
||||||
players[thirdplaya].mo->color = players[thirdplaya].skincolor;
|
players[thirdplaya].mo->color = players[thirdplaya].skincolor;
|
||||||
|
|
||||||
|
// Update follower for local games:
|
||||||
|
if (cv_follower3.value >= 0 && cv_follower3.value != players[thirdplaya].followerskin)
|
||||||
|
SetFollower(thirdplaya, cv_follower3.value);
|
||||||
|
|
||||||
if ((foundskin = R_SkinAvailable(cv_skin3.string)) != -1)
|
if ((foundskin = R_SkinAvailable(cv_skin3.string)) != -1)
|
||||||
{
|
{
|
||||||
//boolean notsame;
|
//boolean notsame;
|
||||||
|
@ -1701,6 +1713,10 @@ static void SendNameAndColor4(void)
|
||||||
if (players[fourthplaya].mo)
|
if (players[fourthplaya].mo)
|
||||||
players[fourthplaya].mo->color = players[fourthplaya].skincolor;
|
players[fourthplaya].mo->color = players[fourthplaya].skincolor;
|
||||||
|
|
||||||
|
// Update follower for local games:
|
||||||
|
if (cv_follower4.value >= 0 && cv_follower4.value != players[fourthplaya].followerskin)
|
||||||
|
SetFollower(fourthplaya, cv_follower4.value);
|
||||||
|
|
||||||
if ((foundskin = R_SkinAvailable(cv_skin4.string)) != -1)
|
if ((foundskin = R_SkinAvailable(cv_skin4.string)) != -1)
|
||||||
{
|
{
|
||||||
//boolean notsame;
|
//boolean notsame;
|
||||||
|
@ -2129,6 +2145,9 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean r
|
||||||
}
|
}
|
||||||
|
|
||||||
chmappending++;
|
chmappending++;
|
||||||
|
|
||||||
|
// send infos. This seems very dumb but we use this for offline games and followers as some kind of band aid
|
||||||
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
WRITEUINT32(buf_p, M_RandomizedSeed()); // random seed
|
WRITEUINT32(buf_p, M_RandomizedSeed()); // random seed
|
||||||
SendNetXCmd(XD_MAP, buf, buf_p - buf);
|
SendNetXCmd(XD_MAP, buf, buf_p - buf);
|
||||||
|
|
|
@ -8576,7 +8576,7 @@ static void M_SetupMultiPlayer2(INT32 choice)
|
||||||
setupm_cvskin = &cv_skin2;
|
setupm_cvskin = &cv_skin2;
|
||||||
setupm_cvcolor = &cv_playercolor2;
|
setupm_cvcolor = &cv_playercolor2;
|
||||||
setupm_cvname = &cv_playername2;
|
setupm_cvname = &cv_playername2;
|
||||||
setupm_cvfollower = &cv_follower;
|
setupm_cvfollower = &cv_follower2;
|
||||||
|
|
||||||
setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value
|
setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value
|
||||||
|
|
||||||
|
@ -8616,7 +8616,7 @@ static void M_SetupMultiPlayer3(INT32 choice)
|
||||||
setupm_cvskin = &cv_skin3;
|
setupm_cvskin = &cv_skin3;
|
||||||
setupm_cvcolor = &cv_playercolor3;
|
setupm_cvcolor = &cv_playercolor3;
|
||||||
setupm_cvname = &cv_playername3;
|
setupm_cvname = &cv_playername3;
|
||||||
setupm_cvfollower = &cv_follower;
|
setupm_cvfollower = &cv_follower3;
|
||||||
|
|
||||||
setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value
|
setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value
|
||||||
|
|
||||||
|
@ -8656,7 +8656,7 @@ static void M_SetupMultiPlayer4(INT32 choice)
|
||||||
setupm_cvskin = &cv_skin4;
|
setupm_cvskin = &cv_skin4;
|
||||||
setupm_cvcolor = &cv_playercolor4;
|
setupm_cvcolor = &cv_playercolor4;
|
||||||
setupm_cvname = &cv_playername4;
|
setupm_cvname = &cv_playername4;
|
||||||
setupm_cvfollower = &cv_follower;
|
setupm_cvfollower = &cv_follower4;
|
||||||
|
|
||||||
setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value
|
setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value
|
||||||
|
|
||||||
|
|
10
src/p_user.c
10
src/p_user.c
|
@ -9044,8 +9044,8 @@ static void P_HandleFollower(player_t *player)
|
||||||
player->follower->extravalue1 = 2;
|
player->follower->extravalue1 = 2;
|
||||||
P_SetFollowerState(player->follower, fl.hurtstate);
|
P_SetFollowerState(player->follower, fl.hurtstate);
|
||||||
}
|
}
|
||||||
if (player->mo->health <= 0) // if dead, snap to z pos
|
if (player->mo->health <= 0) // if dead, follow the player's z momentum exactly so they both look like they die at the same speed.
|
||||||
player->follower->z = sz;
|
player->follower->momz = player->mo->momz;
|
||||||
}
|
}
|
||||||
else if (player->speed > 10*player->mo->scale)
|
else if (player->speed > 10*player->mo->scale)
|
||||||
{
|
{
|
||||||
|
@ -9151,6 +9151,9 @@ void P_PlayerThink(player_t *player)
|
||||||
player->awayviewtics = 0; // reset to zero
|
player->awayviewtics = 0; // reset to zero
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run followes here. We need them to run even when we're dead to follow through what we're doing.
|
||||||
|
P_HandleFollower(player);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (player->pflags & PF_GLIDING)
|
if (player->pflags & PF_GLIDING)
|
||||||
{
|
{
|
||||||
|
@ -9622,9 +9625,6 @@ void P_PlayerThink(player_t *player)
|
||||||
|
|
||||||
K_KartPlayerThink(player, cmd); // SRB2kart
|
K_KartPlayerThink(player, cmd); // SRB2kart
|
||||||
|
|
||||||
// we're done doing all of this, now take care of followers...
|
|
||||||
P_HandleFollower(player);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Colormap verification
|
// Colormap verification
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue