mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Properly use 0 power for the guest player
This commit is contained in:
parent
8228377a0e
commit
abac095d06
3 changed files with 37 additions and 9 deletions
|
|
@ -24,7 +24,13 @@ INT32 PR_GetNumProfiles(void)
|
||||||
return numprofiles;
|
return numprofiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
profile_t* PR_MakeProfile(const char *prname, const char *pname, const char *sname, const UINT16 col, const char *fname, UINT16 fcol, INT32 controlarray[num_gamecontrols][MAXINPUTMAPPING])
|
profile_t* PR_MakeProfile(
|
||||||
|
const char *prname,
|
||||||
|
const char *pname,
|
||||||
|
const char *sname, const UINT16 col,
|
||||||
|
const char *fname, const UINT16 fcol,
|
||||||
|
INT32 controlarray[num_gamecontrols][MAXINPUTMAPPING],
|
||||||
|
boolean guest)
|
||||||
{
|
{
|
||||||
profile_t *new = Z_Malloc(sizeof(profile_t), PU_STATIC, NULL);
|
profile_t *new = Z_Malloc(sizeof(profile_t), PU_STATIC, NULL);
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
|
|
@ -48,7 +54,7 @@ profile_t* PR_MakeProfile(const char *prname, const char *pname, const char *sna
|
||||||
// Init both power levels
|
// Init both power levels
|
||||||
for (i = 0; i < PWRLV_NUMTYPES; i++)
|
for (i = 0; i < PWRLV_NUMTYPES; i++)
|
||||||
{
|
{
|
||||||
new->powerlevels[i] = PWRLVRECORD_START;
|
new->powerlevels[i] = (guest ? 0 : PWRLVRECORD_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new;
|
return new;
|
||||||
|
|
@ -57,7 +63,7 @@ profile_t* PR_MakeProfile(const char *prname, const char *pname, const char *sna
|
||||||
profile_t* PR_MakeProfileFromPlayer(const char *prname, const char *pname, const char *sname, const UINT16 col, const char *fname, UINT16 fcol, UINT8 pnum)
|
profile_t* PR_MakeProfileFromPlayer(const char *prname, const char *pname, const char *sname, const UINT16 col, const char *fname, UINT16 fcol, UINT8 pnum)
|
||||||
{
|
{
|
||||||
// Generate profile using the player's gamecontrol, as we set them directly when making profiles from menus.
|
// Generate profile using the player's gamecontrol, as we set them directly when making profiles from menus.
|
||||||
profile_t *new = PR_MakeProfile(prname, pname, sname, col, fname, fcol, gamecontrol[pnum]);
|
profile_t *new = PR_MakeProfile(prname, pname, sname, col, fname, fcol, gamecontrol[pnum], false);
|
||||||
|
|
||||||
// Player bound cvars:
|
// Player bound cvars:
|
||||||
new->kickstartaccel = cv_kickstartaccel[pnum].value;
|
new->kickstartaccel = cv_kickstartaccel[pnum].value;
|
||||||
|
|
@ -160,7 +166,14 @@ void PR_InitNewProfile(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dprofile = PR_MakeProfile(pname, PROFILEDEFAULTPNAME, PROFILEDEFAULTSKIN, PROFILEDEFAULTCOLOR, PROFILEDEFAULTFOLLOWER, PROFILEDEFAULTFOLLOWERCOLOR, gamecontroldefault);
|
dprofile = PR_MakeProfile(
|
||||||
|
pname,
|
||||||
|
PROFILEDEFAULTPNAME,
|
||||||
|
PROFILEDEFAULTSKIN, PROFILEDEFAULTCOLOR,
|
||||||
|
PROFILEDEFAULTFOLLOWER, PROFILEDEFAULTFOLLOWERCOLOR,
|
||||||
|
gamecontroldefault,
|
||||||
|
false
|
||||||
|
);
|
||||||
PR_AddProfile(dprofile);
|
PR_AddProfile(dprofile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,7 +202,15 @@ void PR_SaveProfiles(void)
|
||||||
void PR_LoadProfiles(void)
|
void PR_LoadProfiles(void)
|
||||||
{
|
{
|
||||||
FILE *f = NULL;
|
FILE *f = NULL;
|
||||||
profile_t *dprofile = PR_MakeProfile(PROFILEDEFAULTNAME, PROFILEDEFAULTPNAME, PROFILEDEFAULTSKIN, PROFILEDEFAULTCOLOR, PROFILEDEFAULTFOLLOWER, PROFILEDEFAULTFOLLOWERCOLOR, gamecontroldefault);
|
profile_t *dprofile = PR_MakeProfile(
|
||||||
|
PROFILEDEFAULTNAME,
|
||||||
|
PROFILEDEFAULTPNAME,
|
||||||
|
PROFILEDEFAULTSKIN, PROFILEDEFAULTCOLOR,
|
||||||
|
PROFILEDEFAULTFOLLOWER, PROFILEDEFAULTFOLLOWERCOLOR,
|
||||||
|
gamecontroldefault,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
f = fopen(va(pandf, srb2home, PROFILESFILE), "r");
|
f = fopen(va(pandf, srb2home, PROFILESFILE), "r");
|
||||||
|
|
||||||
if (f != NULL)
|
if (f != NULL)
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@
|
||||||
#define PROFILESFILE "ringprofiles.prf"
|
#define PROFILESFILE "ringprofiles.prf"
|
||||||
#define PROFILE_GUEST 0
|
#define PROFILE_GUEST 0
|
||||||
|
|
||||||
#define PROFILEDEFAULTNAME "guest"
|
#define PROFILEDEFAULTNAME "GUEST"
|
||||||
#define PROFILEDEFAULTPNAME "Player"
|
#define PROFILEDEFAULTPNAME "Guest"
|
||||||
#define PROFILEDEFAULTSKIN "eggman"
|
#define PROFILEDEFAULTSKIN "eggman"
|
||||||
#define PROFILEDEFAULTCOLOR SKINCOLOR_NONE
|
#define PROFILEDEFAULTCOLOR SKINCOLOR_NONE
|
||||||
#define PROFILEDEFAULTFOLLOWER "none"
|
#define PROFILEDEFAULTFOLLOWER "none"
|
||||||
|
|
@ -78,7 +78,14 @@ INT32 PR_GetNumProfiles(void);
|
||||||
// PR_MakeProfile
|
// PR_MakeProfile
|
||||||
// Makes a profile from the supplied profile name, player name, colour, follower, followercolour and controls.
|
// Makes a profile from the supplied profile name, player name, colour, follower, followercolour and controls.
|
||||||
// The consvar values are left untouched.
|
// The consvar values are left untouched.
|
||||||
profile_t* PR_MakeProfile(const char *prname, const char *pname, const char *sname, const UINT16 col, const char *fname, UINT16 fcol, INT32 controlarray[num_gamecontrols][MAXINPUTMAPPING]);
|
profile_t* PR_MakeProfile(
|
||||||
|
const char *prname,
|
||||||
|
const char *pname,
|
||||||
|
const char *sname, const UINT16 col,
|
||||||
|
const char *fname, const UINT16 fcol,
|
||||||
|
INT32 controlarray[num_gamecontrols][MAXINPUTMAPPING],
|
||||||
|
boolean guest
|
||||||
|
);
|
||||||
|
|
||||||
// PR_MakeProfileFromPlayer
|
// PR_MakeProfileFromPlayer
|
||||||
// Makes a profile_t from the supplied profile name, player name, colour, follower and followercolour.
|
// Makes a profile_t from the supplied profile name, player name, colour, follower and followercolour.
|
||||||
|
|
|
||||||
|
|
@ -504,7 +504,7 @@ void Y_IntermissionDrawer(void)
|
||||||
{
|
{
|
||||||
if (powertype != PWRLV_DISABLED && !clientpowerlevels[data.num[i]][powertype])
|
if (powertype != PWRLV_DISABLED && !clientpowerlevels[data.num[i]][powertype])
|
||||||
{
|
{
|
||||||
// No power level (splitscreen guests)
|
// No power level (guests)
|
||||||
STRBUFCPY(strtime, "----");
|
STRBUFCPY(strtime, "----");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue