Skip to content

HUD: Fix nil translation before the round state is synced - #1885

Open
ROODAY wants to merge 1 commit into
TTT-2:masterfrom
ROODAY:fix-hud-roundstate-nil
Open

ROODAY wants to merge 1 commit into
TTT-2:masterfrom
ROODAY:fix-hud-roundstate-nil

Conversation

@ROODAY

@ROODAY ROODAY commented Nov 4, 2026 •

Copy link
Copy Markdown

Summary

Fixes the bottom-left info panel rendering [ERROR: Translation of nil not found] in all caps when the client has not received a round state yet.

This was discovered while doing singleplayer testing, so it's a rare edge case — but it is fully deterministic there:

  1. The client only learns the round state from the TTT_RoundState net message (GAMEMODE.round_state).
  2. That message is normally sent by gameloop.PlayerReady, which is triggered by the client's ready handshake in GM:SetupMove.
  3. GM:SetupMove is a predicted hook and is not called in the client realm in singleplayer, so the handshake never runs.
  4. With a single player and ttt_minimum_players at its default of 2, the server also never leaves ROUND_WAIT, so no later state-change broadcast repairs the client.
  5. The info panel then does L[self.roundstate_string[nil]], and the default-language metatable in cl_lang.lua returns "[ERROR: Translation of nil not found]" for the nil key. The HUD uppercases the text, which is why it shows up in all caps.

Fix

The round-state lookup now falls back to the round_wait translation while the state is unknown, in both HUD skins:

  • gamemodes/terrortown/gamemode/shared/hud_elements/tttinfopanel/pure_skin_playerinfo.lua
  • gamemodes/terrortown/gamemode/shared/hud_elements/tttinfopanel/old_ttt_info.lua (two lookup sites)

This is display-only; the underlying singleplayer ready-handshake behaviour is unchanged.

Screenshots

Before

image

After

image

🤖 Generated with Claude Code

The round state is only known on the client after the TTT_RoundState net
message. In singleplayer the predicted SetupMove hook is not called on
the client, so the ready handshake that triggers gameloop.PlayerReady
never runs and no round state is sent. With only one player the game also
stays in ROUND_WAIT, so no state change is broadcast that would repair
the client. The info panel then looked up L[nil], which the language
metatable turns into "[ERROR: Translation of nil not found]".

Fall back to the waiting text while the round state is unknown, in both
the pure skin and the old info panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ROODAY

ROODAY commented Nov 5, 2026

Copy link
Copy Markdown
Author

@saibotk just tagging you as I saw you were the most recently active in other prs!

This branch has not been deployed

No deployments
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