Fix spelling typos and improve code quality (#2186)

## Description:
  This PR fixes several bugs and improves code quality:

- Fix spelling typos: "recieved" → "received" in Transport.ts and
GameServer.ts
  - Fix comment typo: "isn'te" → "isn't" in TerrainLayer.ts
- Improve WebSocket cleanup in Transport.ts leaveGame() by replacing
empty onclose handler with proper
   killExistingSocket() call
- Add console.warn for image decode failures in StructureLayer.ts
instead of silent catch
  - Remove commented dead code in DevConfig.ts

  ## Testing
All 288 tests pass. Development build completes successfully. No
breaking changes.

  ## Files Changed
  - src/client/Transport.ts
  - src/server/GameServer.ts
  - src/client/graphics/layers/TerrainLayer.ts
  - src/client/graphics/layers/StructureLayer.ts
  - src/core/configuration/DevConfig.ts

## Checklist:
- [x] I have added screenshots for all UI updates (N/A - no UI changes)
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file (N/A - no user-facing text)
- [x] I have added relevant tests to the test directory (All 288
existing tests pass - no new tests needed for typo fixes)
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

  Discord: hiphex_33496

Hiphex

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Hiphex
2025-10-14 22:07:49 +00:00
committed by GitHub
co-authored by Claude
parent 5f6b85ebfc
commit fee2f822ed
5 changed files with 8 additions and 11 deletions
+3 -1
View File
@@ -138,7 +138,9 @@ export class StructureLayer implements Layer {
Promise.all(
Array.from(this.unitIcons.values()).map((img) =>
img.decode?.().catch(() => {}),
img.decode?.().catch((err) => {
console.warn("Failed to decode unit icon image:", err);
}),
),
).finally(() => {
this.game.units().forEach((u) => this.handleUnitRendering(u));
+1 -1
View File
@@ -49,7 +49,7 @@ export class TerrainLayer implements Layer {
this.theme = this.game.config().theme();
this.game.forEachTile((tile) => {
const terrainColor = this.theme.terrainColor(this.game, tile);
// TODO: isn'te tileref and index the same?
// TODO: isn't tileref and index the same?
const index = this.game.y(tile) * this.game.width() + this.game.x(tile);
const offset = index * 4;
this.imageData.data[offset] = terrainColor.rgba.r;