From 9b5081ae10f4b40bd66ad34f585cbdeb8d4d813d Mon Sep 17 00:00:00 2001 From: Ashnal Date: Sun, 20 Jul 2025 23:15:52 -0400 Subject: [PATCH] Fix Ring Shooter Ensures an old shooter can't grab you after you've used it and try to use a new one Enforces the two second cooldown on spawning Ring Shooter --- src/objects/ring-shooter.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/objects/ring-shooter.c b/src/objects/ring-shooter.c index 2f731a7cd..360ce3b39 100644 --- a/src/objects/ring-shooter.c +++ b/src/objects/ring-shooter.c @@ -66,7 +66,8 @@ static void RemoveRingShooterPointer(mobj_t *base) if (playeringame[ rs_base_playerid(base) ]) { player = &players[ rs_base_playerid(base) ]; - P_SetTarget(&player->ringShooter, NULL); + if (player->ringShooter == base) + P_SetTarget(&player->ringShooter, NULL); } // Remove our player ID @@ -439,6 +440,8 @@ void Obj_PlayerUsedRingShooter(mobj_t *base, player_t *player) player->respawn.fromRingShooter = true; K_DoIngameRespawn(player); + P_SetTarget(&player->ringShooter, NULL); + // Now other players can run into it! base->flags |= MF_SPECIAL; @@ -654,6 +657,7 @@ static boolean AllowRingShooter(const player_t *player) && player->nocontrol == 0 && player->fastfall == 0 && player->speed < minSpeed + && player->freeRingShooterCooldown == 0 && P_PlayerInPain(player) == false && P_IsObjectOnGround(player->mo) == true) { @@ -735,6 +739,7 @@ void Obj_RingShooterInput(player_t *player) { // We released during the intro animation. // Cancel it entirely, prevent another one being created for a bit. + player->freeRingShooterCooldown = 2*TICRATE; rs_base_canceled(base) = 1; if (base->fuse > RS_FUSE_BLINK)