mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-04 20:56:14 +00:00
* Fix follower colour being limited to UINT8.
* Fix follower colour not being set in offline mode (based on Steel's fix but no UINT8).
This commit is contained in:
parent
d54cfcdc7b
commit
316cd61d9f
3 changed files with 17 additions and 13 deletions
|
|
@ -776,10 +776,10 @@ void D_RegisterClientCommands(void)
|
|||
Followercolor_cons_t[i].strvalue = skincolors[i-2].name;
|
||||
}
|
||||
|
||||
Followercolor_cons_t[1].value = -1;
|
||||
Followercolor_cons_t[1].value = UINT16_MAX;
|
||||
Followercolor_cons_t[1].strvalue = "Match"; // Add "Match" option, which will make the follower color match the player's
|
||||
|
||||
Followercolor_cons_t[0].value = -2;
|
||||
Followercolor_cons_t[0].value = UINT16_MAX-1;
|
||||
Followercolor_cons_t[0].strvalue = "Opposite"; // Add "Opposite" option, ...which is like "Match", but for coloropposite.
|
||||
|
||||
Color_cons_t[MAXSKINCOLORS].value = Followercolor_cons_t[MAXSKINCOLORS+2].value = 0;
|
||||
|
|
@ -1443,6 +1443,8 @@ static void SendNameAndColor(UINT8 n)
|
|||
if (cv_follower[n].value >= -1 && cv_follower[n].value != player->followerskin)
|
||||
SetFollower(playernum, cv_follower[n].value);
|
||||
|
||||
player->followercolor = cv_followercolor[n].value;
|
||||
|
||||
if (metalrecording && n == 0)
|
||||
{ // Starring Metal Sonic as themselves, obviously.
|
||||
SetPlayerSkinByNum(playernum, 5);
|
||||
|
|
@ -1497,7 +1499,7 @@ static void SendNameAndColor(UINT8 n)
|
|||
WRITEUINT16(p, (UINT16)cv_playercolor[n].value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin[n].value);
|
||||
WRITESINT8(p, (SINT8)cv_follower[n].value);
|
||||
WRITEUINT16(p, (UINT8)cv_followercolor[n].value);
|
||||
WRITEUINT16(p, (UINT16)cv_followercolor[n].value);
|
||||
|
||||
SendNetXCmdForPlayer(n, XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
|
|
|||
18
src/g_demo.c
18
src/g_demo.c
|
|
@ -299,12 +299,14 @@ void G_ReadDemoExtraData(void)
|
|||
// Follower's color
|
||||
M_Memcpy(name, demo_p, 16);
|
||||
demo_p += 16;
|
||||
for (i = 0; i < numskincolors; i++)
|
||||
if (!stricmp(skincolors[i].name, name)) // SRB2kart
|
||||
{
|
||||
players[p].followercolor = i;
|
||||
break;
|
||||
}
|
||||
for (i = 0; i < numskincolors +2; i++) // +2 because of Match and Opposite
|
||||
{
|
||||
if (!stricmp(Followercolor_cons_t[i].strvalue, name))
|
||||
{
|
||||
players[p].followercolor = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (extradata & DXD_PLAYSTATE)
|
||||
{
|
||||
|
|
@ -443,7 +445,7 @@ void G_WriteDemoExtraData(void)
|
|||
|
||||
// write follower color
|
||||
memset(name, 0, 16);
|
||||
strncpy(name, Followercolor_cons_t[players[i].followercolor].strvalue, 16); // Not KartColor_Names because followercolor has extra values such as "Match"
|
||||
strncpy(name, Followercolor_cons_t[(UINT16)(players[i].followercolor+2)].strvalue, 16); // Not KartColor_Names because followercolor has extra values such as "Match"
|
||||
M_Memcpy(demo_p,name,16);
|
||||
demo_p += 16;
|
||||
|
||||
|
|
@ -2056,7 +2058,7 @@ void G_BeginRecording(void)
|
|||
|
||||
// Save follower's colour
|
||||
memset(name, 0, 16);
|
||||
strncpy(name, Followercolor_cons_t[player->followercolor].strvalue, 16); // Not KartColor_Names because followercolor has extra values such as "Match"
|
||||
strncpy(name, Followercolor_cons_t[(UINT16)(player->followercolor+2)].strvalue, 16); // Not KartColor_Names because followercolor has extra values such as "Match"
|
||||
M_Memcpy(demo_p, name, 16);
|
||||
demo_p += 16;
|
||||
|
||||
|
|
|
|||
|
|
@ -3965,10 +3965,10 @@ static void P_HandleFollower(player_t *player)
|
|||
// Set follower colour
|
||||
switch (player->followercolor)
|
||||
{
|
||||
case 255: // "Match" (-1)
|
||||
case UINT16_MAX: // "Match"
|
||||
color = player->skincolor;
|
||||
break;
|
||||
case 254: // "Opposite" (-2)
|
||||
case UINT16_MAX-1: // "Opposite"
|
||||
color = skincolors[player->skincolor].invcolor;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue