Commit graph

2 commits

Author SHA1 Message Date
Vadim Peretokin
b741663a1c
infrastructure: drop comments that restate the code beside them (#9681)
#### Brief overview of PR changes/additions
- Removed 8 comments that only repeated the statement or assertion
message next to them
- Kept 1 of the 16 identical copies of the `lua_next()` key-copy note in
`TLuaInterpreterMedia.cpp`
- Comment-only: zero code lines changed

#### Motivation for adding to Mudlet
Reading a comment and then the code that says the same thing is wasted
effort; the rationale comments that document real gotchas are all
untouched.

#### Other info (issues closed, discussion etc)
Result of a pass over the last month of commits on `development`. The
vast majority of comments added there explain *why* rather than restate
*what*, so this is deliberately a small diff.

**Test case:** `git diff development...HEAD` shows only comment lines
removed; build and test suites are unaffected.


Assisted-by: Claude:claude-opus-5
Signed-off-by: Vadim Peretokin <vadim.peretokin@mudlet.org>
2026-08-11 08:06:16 +02:00
Vadim Peretokin
73a8dbcd8d
fix: bold text no longer brings back a colour the game already reset (#9515)
#### Brief overview of PR changes/additions
- SGR 39 (default foreground colour) now restores full default-colour
semantics: it also clears the explicit-colour flag and the stored bright
variant of the old colour, matching what SGR 0 does
- Adds a functional test (`TelnetSgrDefaultColorTest`, 9 cases) covering
the reported sequence, resets, brightening, the SGR 49 background
analog, and real bytes captured from the reporting game - 3 cases fail
without the fix

#### Motivation for adding to Mudlet
Games that reset colours with `ESC[39m` instead of `ESC[0m` had the old
colour resurrected in bright form by any later `ESC[1m` (bold) - e.g.
eden-test.rpgframework.de's client compatibility screen rendered its
bold headers and labels red where every terminal emulator shows them in
the default colour.

| Before | After |
| --- | --- |
| <img width="1920" height="1080" alt="before: compatibility screen
headers and labels wrongly red"
src="https://github.com/user-attachments/assets/1bc0a790-6ac1-43d3-a856-f6d168105ff9"
/> | <img width="1920" height="1080" alt="after: headers and labels in
the default colour"
src="https://github.com/user-attachments/assets/8f6ca4e9-ba06-4365-bbfa-28aa6f9191ab"
/> |

#### Other info (issues closed, discussion etc)
Fixes #9466

Root cause: `TBuffer::decodeSGR()`'s `case 39:` only reset
`mForeGroundColor`, leaving `mIsDefaultColor == false` and
`mForeGroundColorLight` stale, while characters are built with
`(!mIsDefaultColor && mBold) ? mForeGroundColorLight :
mForeGroundColor`. SGR 49 needs no equivalent: backgrounds have no
bright variant and `mIsDefaultColor` only governs the foreground.

**Test case:** connect to `eden-test.rpgframework.de:4000`, create an
account, choose option 2 ("Check client compatibility") - section
headers and labels render in the default colour (bold), not red.
Automated: `ctest -R TelnetSgrDefaultColorTest`.
2026-07-27 22:02:30 +02:00