mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Netsync setrings and setlives
- setrings no longer subtracts totalrings - removed INFLIVES
This commit is contained in:
parent
57a3c4109c
commit
db92d9068e
5 changed files with 33 additions and 27 deletions
|
|
@ -1995,6 +1995,13 @@ void D_Cheat(INT32 playernum, INT32 cheat, ...)
|
||||||
|
|
||||||
switch (cheat)
|
switch (cheat)
|
||||||
{
|
{
|
||||||
|
case CHEAT_RINGS:
|
||||||
|
case CHEAT_LIVES:
|
||||||
|
// If you're confused why 'int' instead of
|
||||||
|
// 'SINT8', search online: 'default argument promotions'
|
||||||
|
COPY(WRITESINT8, int);
|
||||||
|
break;
|
||||||
|
|
||||||
case CHEAT_SCALE:
|
case CHEAT_SCALE:
|
||||||
COPY(WRITEFIXED, fixed_t);
|
COPY(WRITEFIXED, fixed_t);
|
||||||
break;
|
break;
|
||||||
|
|
@ -5495,6 +5502,28 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case CHEAT_RINGS: {
|
||||||
|
SINT8 rings = READSINT8(*cp);
|
||||||
|
|
||||||
|
// P_GivePlayerRings does value clamping
|
||||||
|
player->rings = 0;
|
||||||
|
P_GivePlayerRings(player, rings);
|
||||||
|
|
||||||
|
CV_CheaterWarning(targetPlayer, va("rings = %d", rings));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case CHEAT_LIVES: {
|
||||||
|
SINT8 lives = READSINT8(*cp);
|
||||||
|
|
||||||
|
// P_GivePlayerLives does value clamping
|
||||||
|
player->lives = 0;
|
||||||
|
P_GivePlayerLives(player, lives);
|
||||||
|
|
||||||
|
CV_CheaterWarning(targetPlayer, va("lives = %d", lives));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case CHEAT_SCALE: {
|
case CHEAT_SCALE: {
|
||||||
const fixed_t smin = FRACUNIT/100;
|
const fixed_t smin = FRACUNIT/100;
|
||||||
const fixed_t smax = 100*FRACUNIT;
|
const fixed_t smax = 100*FRACUNIT;
|
||||||
|
|
|
||||||
|
|
@ -602,7 +602,4 @@ typedef struct player_s
|
||||||
#endif
|
#endif
|
||||||
} player_t;
|
} player_t;
|
||||||
|
|
||||||
// Value for infinite lives
|
|
||||||
#define INFLIVES 0x7F
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6347,9 +6347,6 @@ struct int_const_s const INT_CONST[] = {
|
||||||
{"PA_DRIFT",PA_DRIFT},
|
{"PA_DRIFT",PA_DRIFT},
|
||||||
{"PA_HURT",PA_HURT},
|
{"PA_HURT",PA_HURT},
|
||||||
|
|
||||||
// Value for infinite lives
|
|
||||||
{"INFLIVES",INFLIVES},
|
|
||||||
|
|
||||||
// Got Flags, for player->gotflag!
|
// Got Flags, for player->gotflag!
|
||||||
// Used to be MF_ for some stupid reason, now they're GF_ to stop them looking like mobjflags
|
// Used to be MF_ for some stupid reason, now they're GF_ to stop them looking like mobjflags
|
||||||
{"GF_REDFLAG",GF_REDFLAG},
|
{"GF_REDFLAG",GF_REDFLAG},
|
||||||
|
|
|
||||||
|
|
@ -748,13 +748,7 @@ void Command_Setrings_f(void)
|
||||||
REQUIRE_CHEATS;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
|
|
||||||
if (COM_Argc() > 1)
|
D_Cheat(consoleplayer, CHEAT_RINGS, atoi(COM_Argv(1)));
|
||||||
{
|
|
||||||
// P_GivePlayerRings does value clamping
|
|
||||||
players[consoleplayer].rings = 0;
|
|
||||||
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
|
|
||||||
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Command_Setlives_f(void)
|
void Command_Setlives_f(void)
|
||||||
|
|
@ -762,20 +756,7 @@ void Command_Setlives_f(void)
|
||||||
REQUIRE_CHEATS;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
|
|
||||||
if (COM_Argc() > 1)
|
D_Cheat(consoleplayer, CHEAT_LIVES, atoi(COM_Argv(1)));
|
||||||
{
|
|
||||||
SINT8 lives = atoi(COM_Argv(1));
|
|
||||||
if (lives == -1)
|
|
||||||
{
|
|
||||||
players[consoleplayer].lives = INFLIVES; // infinity!
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// P_GivePlayerLives does value clamping
|
|
||||||
players[consoleplayer].lives = 0;
|
|
||||||
P_GivePlayerLives(&players[consoleplayer], atoi(COM_Argv(1)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CHEAT_NOCLIP,
|
CHEAT_NOCLIP,
|
||||||
CHEAT_GOD,
|
CHEAT_GOD,
|
||||||
|
CHEAT_RINGS,
|
||||||
|
CHEAT_LIVES,
|
||||||
CHEAT_SCALE,
|
CHEAT_SCALE,
|
||||||
CHEAT_FLIP,
|
CHEAT_FLIP,
|
||||||
CHEAT_HURT,
|
CHEAT_HURT,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue