From eee77d0f1b0b1628aa0097230d3b7cbc97327d1e Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Wed, 22 Apr 2026 20:37:00 -0700 Subject: [PATCH] Prevent teleport control from working on twitch redeems to teleport the player --- src/twitch.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/twitch.c b/src/twitch.c index 63156bd28..6761c702e 100644 --- a/src/twitch.c +++ b/src/twitch.c @@ -34,7 +34,7 @@ void check_twitch(void) { } time_t now = getnow(); - if (timet_delta(now, last_check) < 2) { + if (timet_delta(now, last_check) < 5) { return; } @@ -94,13 +94,31 @@ staticfn void process_twitch_cmd(char *cmd) { identify_pack(1, TRUE); successful_effect(id); } else if (!strcmp(effect, "teleport")) { + /* Temporarily stun the player, if they are not already, to prevent teleport control */ + boolean removestun = FALSE; + if (!Stunned) { + removestun = TRUE; + make_stunned(1L, FALSE); + } tele(); + if (removestun) { + make_stunned(0L, FALSE); + } successful_effect(id); } else if (!strcmp(effect, "level_teleport")) { if (u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz)) { failed_effect(id); } else { + /* Temporarily stun the player, if they are not already, to prevent teleport control */ + boolean removestun = FALSE; + if (!Stunned) { + removestun = TRUE; + make_stunned(1L, FALSE); + } level_tele(); + if (removestun) { + make_stunned(0L, FALSE); + } successful_effect(id); } } else if (!strcmp(effect, "healing")) {