Move airdrop-related flags to its own variable
This commit is contained in:
parent
c87c5fd8cd
commit
2a84eda311
4 changed files with 25 additions and 15 deletions
|
|
@ -65,16 +65,14 @@ typedef enum
|
|||
{
|
||||
PF_GODMODE = 1<<0, // Immortal.
|
||||
|
||||
// free: 1<<1
|
||||
PF_BOUNCYAIRDROP = 1<<2, // Enables bouncy (RR) air-drop for players.
|
||||
// free: 1<<1 and 1<<2
|
||||
|
||||
// Look back VFX has been spawned
|
||||
// TODO: Is there a better way to track this?
|
||||
PF_GAINAX = 1<<3,
|
||||
PF_KICKSTARTACCEL = 1<<4, // Accessibility feature: Is accelerate in kickstart mode?
|
||||
|
||||
PF_WANTSAIRDROP = 1<<5, // Wants air drop (active while holding down brake, used for bouncy air drop)
|
||||
PF_AIRDROP = 1<<6, // Is in Air Drop (activation / deactivation criteria change if light or heavy)
|
||||
|
||||
// free: 1<<5 and 1<<6
|
||||
|
||||
PF_WANTSTOJOIN = 1<<7, // Spectator that wants to join
|
||||
|
||||
|
|
@ -113,6 +111,13 @@ typedef enum
|
|||
PF_SLIDING = 1<<31, // For lua compat, don't use!
|
||||
} pflags_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PAF_WANTSAIRDROP = 1<<0, // Wants air drop (active while holding down brake, used for bouncy air drop)
|
||||
PAF_AIRDROP = 1<<1, // Is in Air Drop (activation / deactivation criteria change if light or heavy)
|
||||
PAF_BOUNCYAIRDROP = 1<<2, // Enables bouncy (Ring Racers) air-drop for players.
|
||||
} p_airdropflags_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// Are animation frames playing?
|
||||
|
|
@ -508,6 +513,9 @@ struct player_t
|
|||
// See pflags_t, above.
|
||||
pflags_t pflags;
|
||||
|
||||
// Airdrop-exclusive bitflags.
|
||||
p_airdropflags_t airdropflags;
|
||||
|
||||
// playing animation.
|
||||
panim_t panim;
|
||||
|
||||
|
|
|
|||
20
src/k_kart.c
20
src/k_kart.c
|
|
@ -6980,7 +6980,7 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
|
|||
{
|
||||
if (!(cmd->buttons & BT_BRAKE))
|
||||
{
|
||||
player->pflags &= ~PF_WANTSAIRDROP;
|
||||
player->airdropflags &= ~PAF_WANTSAIRDROP;
|
||||
}
|
||||
|
||||
if (!K_AirDropActive() || P_IsObjectOnGround(player->mo)
|
||||
|
|
@ -6989,11 +6989,11 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
|
|||
|| player->respawn
|
||||
)
|
||||
{
|
||||
if ((player->pflags & PF_AIRDROP))
|
||||
if ((player->airdropflags & PAF_AIRDROP))
|
||||
{
|
||||
if (airdropactive == AIRDROP_HEAVY)
|
||||
{
|
||||
if (player->pflags & PF_BOUNCYAIRDROP)
|
||||
if (player->airdropflags & PAF_BOUNCYAIRDROP)
|
||||
{
|
||||
const fixed_t maxBounce = mapobjectscale * 10;
|
||||
const fixed_t minBounce = mapobjectscale;
|
||||
|
|
@ -7053,13 +7053,13 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
player->airdroptime = 0;
|
||||
player->pflags &= ~PF_AIRDROP;
|
||||
player->airdropflags &= ~PAF_AIRDROP;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((cmd->buttons & BT_BRAKE) && !(player->pflags & PF_WANTSAIRDROP))
|
||||
if ((cmd->buttons & BT_BRAKE) && !(player->airdropflags & PAF_WANTSAIRDROP))
|
||||
{
|
||||
if (airdropactive == AIRDROP_HEAVY && !(player->pflags & (PF_AIRDROP|PF_BOUNCYAIRDROP)))
|
||||
if (airdropactive == AIRDROP_HEAVY && !(player->airdropflags & (PAF_AIRDROP|PAF_BOUNCYAIRDROP)))
|
||||
{
|
||||
// TODO: heavy air drop should allow keeping current boost stack
|
||||
S_StartSound(player->mo, sfx_cdfm01);
|
||||
|
|
@ -7069,22 +7069,22 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
|
|||
player->mo->momy = FixedMul(player->mo->momy, 90*FRACUNIT/100);
|
||||
player->mo->momz -= 8*P_MobjFlip(player->mo)*mapobjectscale;
|
||||
}
|
||||
player->pflags |= PF_AIRDROP|PF_WANTSAIRDROP;
|
||||
player->airdropflags |= PAF_AIRDROP|PAF_WANTSAIRDROP;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (airdropactive == AIRDROP_LIGHT && !(cmd->buttons & BT_BRAKE))
|
||||
player->pflags &= ~PF_AIRDROP;
|
||||
player->airdropflags &= ~PAF_AIRDROP;
|
||||
}
|
||||
|
||||
if (player->pflags & PF_AIRDROP)
|
||||
if (player->airdropflags & PAF_AIRDROP)
|
||||
{
|
||||
|
||||
K_SpawnFallLines(player, false);
|
||||
|
||||
if (airdropactive == AIRDROP_HEAVY)
|
||||
{
|
||||
if (player->pflags & PF_BOUNCYAIRDROP)
|
||||
if (player->airdropflags & PAF_BOUNCYAIRDROP)
|
||||
{
|
||||
player->airdroptime = player->mo->momz;
|
||||
if (!S_SoundPlaying(player->mo, sfx_s3kd9l))
|
||||
|
|
|
|||
|
|
@ -1190,6 +1190,7 @@ void Command_ObjectPlace_f(void)
|
|||
// Remove ALL flags and motion.
|
||||
P_UnsetThingPosition(players[0].mo);
|
||||
players[0].pflags = 0;
|
||||
players[0].airdropflags = 0;
|
||||
players[0].mo->flags2 = 0;
|
||||
players[0].mo->eflags = 0;
|
||||
players[0].mo->flags = (MF_NOCLIP|MF_NOGRAVITY|MF_NOBLOCKMAP);
|
||||
|
|
|
|||
|
|
@ -501,6 +501,7 @@ static void P_NetSyncPlayers(savebuffer_t *save)
|
|||
|
||||
SYNC(players[i].playerstate);
|
||||
SYNC(players[i].pflags);
|
||||
SYNC(players[i].airdropflags);
|
||||
SYNC(players[i].panim);
|
||||
SYNCBOOLEAN(players[i].spectator);
|
||||
SYNC(players[i].spectatewait);
|
||||
|
|
|
|||
Loading…
Reference in a new issue