Skip to content

fix(commands): make a level-0 !disable actually disable Torchlight - #210

Merged
Rushaway merged 1 commit into
masterfrom
fix/disable-level-zero
Oct 28, 2026
Merged

Rushaway merged 1 commit into
masterfrom
fix/disable-level-zero

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Problem

Torchlight.disabled holds the admin level that disabled Torchlight, with 0 meaning "enabled". When the Disable command is configured at level 0, a level-0 player's !disable stores disabled = 0:

  • the chat announces "Torchlight has been disabled for the duration of this map",
  • but check_disabled, AudioManager, VoteDisable and Enable all test the value for truthiness, so Torchlight stays fully enabled,
  • and a second !disable announces the same thing again instead of "already disabled".

This was noted in the #177 audit comments as out of scope.

Fix

None now means "enabled", so 0 is a real disable level:

  • Torchlight.disabled is typed int | None and starts as None, and the map start reset in TorchlightHandler sets None.
  • !enable sets None instead of False.
  • check_disabled, AudioManager.AudioPlayer, VoteDisable, Enable and Disable test is None / is not None.

Nothing changes for levels above 0, for vote-disable (6) or for the teardown value (sys.maxsize).

VERSION goes from 1.8.40 to 1.8.41. No config change is needed.

🤖 Generated with Claude Code

Torchlight.disabled stored the disabling level and used 0 as "enabled", so a
!disable from a level-0 player (when the command is configured at level 0)
announced that Torchlight was disabled while every check still treated it as
enabled. Use None as the "enabled" value so level 0 is a real disable level.

Bump VERSION to 1.8.41.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rushaway
Rushaway merged commit 07907b3 into master Oct 28, 2026
3 checks passed
@Rushaway
Rushaway deleted the fix/disable-level-zero branch October 28, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant