mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +00:00
Demo-sync weaponpref data, which just includes kickstartaccel right now.
This commit is contained in:
parent
a43a762b46
commit
879c821d18
3 changed files with 28 additions and 9 deletions
|
|
@ -1642,6 +1642,9 @@ static void Got_WeaponPref(UINT8 **cp,INT32 playernum)
|
||||||
players[playernum].pflags &= ~(PF_KICKSTARTACCEL);
|
players[playernum].pflags &= ~(PF_KICKSTARTACCEL);
|
||||||
if (prefs & 1)
|
if (prefs & 1)
|
||||||
players[playernum].pflags |= PF_KICKSTARTACCEL;
|
players[playernum].pflags |= PF_KICKSTARTACCEL;
|
||||||
|
|
||||||
|
// SEE ALSO g_demo.c
|
||||||
|
demo_extradata[playernum] |= DXD_WEAPONPREF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Got_PowerLevel(UINT8 **cp,INT32 playernum)
|
static void Got_PowerLevel(UINT8 **cp,INT32 playernum)
|
||||||
|
|
|
||||||
17
src/g_demo.c
17
src/g_demo.c
|
|
@ -341,7 +341,13 @@ void G_ReadDemoExtraData(void)
|
||||||
K_CheckBumpers();
|
K_CheckBumpers();
|
||||||
P_CheckRacers();
|
P_CheckRacers();
|
||||||
}
|
}
|
||||||
|
if (extradata & DXD_WEAPONPREF)
|
||||||
|
{
|
||||||
|
extradata = READUINT8(demo_p);
|
||||||
|
players[p].pflags &= ~(PF_KICKSTARTACCEL);
|
||||||
|
if (extradata & 1)
|
||||||
|
players[p].pflags |= PF_KICKSTARTACCEL;
|
||||||
|
}
|
||||||
|
|
||||||
p = READUINT8(demo_p);
|
p = READUINT8(demo_p);
|
||||||
}
|
}
|
||||||
|
|
@ -447,6 +453,13 @@ void G_WriteDemoExtraData(void)
|
||||||
else
|
else
|
||||||
WRITEUINT8(demo_p, DXD_PST_PLAYING);
|
WRITEUINT8(demo_p, DXD_PST_PLAYING);
|
||||||
}
|
}
|
||||||
|
if (demo_extradata[i] & DXD_WEAPONPREF)
|
||||||
|
{
|
||||||
|
UINT8 prefs = 0;
|
||||||
|
if (players[i].pflags & PF_KICKSTARTACCEL)
|
||||||
|
prefs |= 1;
|
||||||
|
WRITEUINT8(demo_p, prefs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
demo_extradata[i] = 0;
|
demo_extradata[i] = 0;
|
||||||
|
|
@ -1068,6 +1081,8 @@ void G_GhostTicker(void)
|
||||||
g->p += 32; // ok (32 because there's both the skin and the colour)
|
g->p += 32; // ok (32 because there's both the skin and the colour)
|
||||||
if (ziptic & DXD_PLAYSTATE && READUINT8(g->p) != DXD_PST_PLAYING)
|
if (ziptic & DXD_PLAYSTATE && READUINT8(g->p) != DXD_PST_PLAYING)
|
||||||
I_Error("Ghost is not a record attack ghost PLAYSTATE"); //@TODO lmao don't blow up like this
|
I_Error("Ghost is not a record attack ghost PLAYSTATE"); //@TODO lmao don't blow up like this
|
||||||
|
if (ziptic & DXD_WEAPONPREF)
|
||||||
|
g->p++; // ditto
|
||||||
}
|
}
|
||||||
else if (ziptic == DW_RNG)
|
else if (ziptic == DW_RNG)
|
||||||
g->p += 4; // RNG seed
|
g->p += 4; // RNG seed
|
||||||
|
|
|
||||||
17
src/g_demo.h
17
src/g_demo.h
|
|
@ -110,16 +110,17 @@ typedef enum
|
||||||
extern UINT8 demo_extradata[MAXPLAYERS];
|
extern UINT8 demo_extradata[MAXPLAYERS];
|
||||||
extern UINT8 demo_writerng;
|
extern UINT8 demo_writerng;
|
||||||
|
|
||||||
#define DXD_RESPAWN 0x01 // "respawn" command in console
|
#define DXD_RESPAWN 0x01 // "respawn" command in console
|
||||||
#define DXD_SKIN 0x02 // skin changed
|
#define DXD_SKIN 0x02 // skin changed
|
||||||
#define DXD_NAME 0x04 // name changed
|
#define DXD_NAME 0x04 // name changed
|
||||||
#define DXD_COLOR 0x08 // color changed
|
#define DXD_COLOR 0x08 // color changed
|
||||||
#define DXD_PLAYSTATE 0x10 // state changed between playing, spectating, or not in-game
|
#define DXD_PLAYSTATE 0x10 // state changed between playing, spectating, or not in-game
|
||||||
#define DXD_FOLLOWER 0x20 // follower was changed
|
#define DXD_FOLLOWER 0x20 // follower was changed
|
||||||
|
#define DXD_WEAPONPREF 0x40 // netsynced playsim settings were changed
|
||||||
|
|
||||||
#define DXD_PST_PLAYING 0x01
|
#define DXD_PST_PLAYING 0x01
|
||||||
#define DXD_PST_SPECTATING 0x02
|
#define DXD_PST_SPECTATING 0x02
|
||||||
#define DXD_PST_LEFT 0x03
|
#define DXD_PST_LEFT 0x03
|
||||||
|
|
||||||
// Record/playback tics
|
// Record/playback tics
|
||||||
void G_ReadDemoExtraData(void);
|
void G_ReadDemoExtraData(void);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue