diff --git a/src/d_player.h b/src/d_player.h index 45f4c6074..2fc8bb62b 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -308,6 +308,7 @@ struct respawnvars_t tic_t dropdash; // Drop Dash charge timer boolean truedeath; // Your soul has left your body boolean manual; // Respawn coords were manually set, please respawn exactly there + boolean init; }; // player_t struct for all bot variables diff --git a/src/k_kart.c b/src/k_kart.c index 603266aed..16d263b00 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9406,17 +9406,28 @@ static INT32 K_FlameShieldMax(player_t *player) boolean K_PlayerEBrake(player_t *player) { + if (player->respawn.state != RESPAWNST_NONE + && player->respawn.init == true) + { + return false; + } + if (player->fastfall != 0) { return true; } - return (K_GetKartButtons(player) & BT_EBRAKEMASK) == BT_EBRAKEMASK + if ((K_GetKartButtons(player) & BT_EBRAKEMASK) == BT_EBRAKEMASK && player->drift == 0 && P_PlayerInPain(player) == false && player->justbumped == 0 && player->spindashboost == 0 - && player->nocontrol == 0; + && player->nocontrol == 0) + { + return true; + } + + return false; } SINT8 K_Sliptiding(player_t *player) @@ -9444,10 +9455,13 @@ void K_KartEbrakeVisuals(player_t *p) { wave = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_SOFTLANDING); P_SetScale(wave, p->mo->scale); - wave->momx = p->mo->momx; - wave->momy = p->mo->momy; - wave->momz = p->mo->momz; - wave->standingslope = p->mo->standingslope; + if (p->respawn.state == RESPAWNST_NONE) + { + wave->momx = p->mo->momx; + wave->momy = p->mo->momy; + wave->momz = p->mo->momz; + wave->standingslope = p->mo->standingslope; + } K_ReduceVFX(wave, p); } @@ -9688,7 +9702,12 @@ static void K_KartSpindash(player_t *player) } // Handle fast falling behaviors first. - if (onGround == false) + if (player->respawn.state != RESPAWNST_NONE) + { + // This is handled in K_MovePlayerToRespawnPoint. + return; + } + else if (onGround == false) { // Update fastfall. player->fastfall = player->mo->momz; diff --git a/src/k_respawn.c b/src/k_respawn.c index 5e3a3ecc6..7d1207b10 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -269,6 +269,7 @@ void K_DoIngameRespawn(player_t *player) player->respawn.timer = RESPAWN_TIME; player->respawn.state = RESPAWNST_MOVE; + player->respawn.init = true; player->respawn.airtimer = player->airtime; player->respawn.truedeath = false; @@ -337,7 +338,7 @@ static void K_MovePlayerToRespawnPoint(player_t *player) player->mo->momx = player->mo->momy = player->mo->momz = 0; player->flashing = 2; - player->nocontrol = max(2, player->nocontrol); + //player->nocontrol = max(2, player->nocontrol); if (leveltime % 8 == 0 && !mapreset) { @@ -366,6 +367,9 @@ static void K_MovePlayerToRespawnPoint(player_t *player) player->mo->z = dest.z; P_SetThingPosition(player->mo); + // At the first valid waypoint, permit extra player control options. + player->respawn.init = false; + // Find the next waypoint to head towards if (player->respawn.wp != NULL) { @@ -446,6 +450,13 @@ static void K_MovePlayerToRespawnPoint(player_t *player) player->mo->momz = step.z; } + if (player->respawn.init == false && K_PlayerEBrake(player) == true) + { + // Manual drop! + player->respawn.state = RESPAWNST_DROP; + return; + } + // NOW THEN, time for loads of dumb duplication! // "Emulate" the rest of the path, that way we can spawn a particle a certain distance ahead of you. diff --git a/src/p_user.c b/src/p_user.c index 34c016d18..1409e7bb4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2219,7 +2219,7 @@ void P_MovePlayer(player_t *player) runspd = FixedMul(runspd, player->mo->movefactor); // Control relinquishing stuff! - if (player->nocontrol) + if (player->nocontrol || player->respawn.state == RESPAWNST_MOVE) player->pflags |= PF_STASIS; // note: don't unset stasis here