fix(client): address PR #54 round 2 — stale comments, D-076 test, GROUND_FLOOR const

Remove stale smoothing re-enable comments from main.gd (Hoshe #1).
Add DIALOGUE_MAX_WIDTH=640 regression test (Hoshe #2).
Extract GROUND_FLOOR const in tile_renderer (Tyre #3).
Clean up entity_renderer migration comment (Hoshe #3).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 14:42:25 +01:00
co-authored by Claude Opus 4.6
parent c347f28cbd
commit 78c8bb97de
4 changed files with 17 additions and 6 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ var _last_dialogue_tick: int = -1
var _last_confrontation_tick: int = -1 # Deduplicate confrontation_monologue signals within same tick
var _known_recognition_ids: Dictionary = {} # D-067: entity_ids that have already chimed
var _flash_rect: ColorRect = null # #502/#501: ephemeral screen flash overlay (shared: teleport preempts amber)
var _teleport_in_progress: bool = false # #501: defer smoothing re-enable by one frame after teleport
var _teleport_in_progress: bool = false # #501/#117: forces camera snap (not lerp) on next _process frame
var _pending_record_inputs: Array = [] # #507: accumulates server-bound inputs across frames; flushed into record_tick() on snapshot arrival
var _current_zone: String = "" # D-073 (#529): zone tracking for ambient crossfades
@@ -47,7 +47,7 @@ func _ready() -> void:
# Camera anchor: snap to player position before the first frame renders.
# In test mode poll_snapshot() returns synchronously — position is set
# immediately. In live mode the snapshot isn't available yet — _process
# handles it. No reset_smoothing() needed: smoothing is OFF.
# handles it via the lerp block in _process().
var first_snapshot: Variant = SimBridge.poll_snapshot()
if first_snapshot != null:
GameState.apply_snapshot(first_snapshot)
+1 -1
View File
@@ -17,7 +17,7 @@ const TILE_SIZE: int = Constants.TILE_SIZE
const ENTITY_WIDTH: int = 24
const ENTITY_HEIGHT: int = 32
const ENTITY_OFFSET_X: float = (TILE_SIZE - ENTITY_WIDTH) / 2.0 # center horizontally
const ENTITY_OFFSET_Y: float = (TILE_SIZE - ENTITY_HEIGHT) / 2.0 # center vertically for placeholder. Migration: when real sprites land, switch to bottom-anchor (TILE_SIZE - ENTITY_HEIGHT) for correct y-sort ordering.
const ENTITY_OFFSET_Y: float = (TILE_SIZE - ENTITY_HEIGHT) / 2.0 # center vertically for placeholder. Migration: switch to bottom-anchor (offset = TILE_SIZE - ENTITY_HEIGHT) when real sprites land for correct y-sort ordering.
# Lerp speed — framerate-independent exponential smoothing.
# At 12.0: ~70% there after 0.1s, ~95% after 0.25s.
+4 -3
View File
@@ -12,6 +12,7 @@ extends TileMapLayer
# (4,0) = reset_plate — amber (#502)
const TILE_SIZE: int = Constants.TILE_SIZE
const GROUND_FLOOR: int = 0 # Server floor level for ground — filter target in update_tiles()
enum TileType { FLOOR = 0, WALL = 1, DOOR = 2, OBJECT = 3, RESET_PLATE = 4 }
@@ -78,10 +79,10 @@ func update_tiles(tiles: Array) -> void:
if not tile_data.has("x") or not tile_data.has("y") or not tile_data.has("type"):
continue
# Floor-level filter: only render tiles at floor level 0 (ground).
# Floor level 1+ tiles are for upper floors (future multi-floor nodes).
# Floor-level filter: only render tiles at ground floor.
# Upper floor tiles (level 1+) are for future multi-floor nodes.
var tile_z: int = tile_data.get("z", 0)
if tile_z != 0:
if tile_z != GROUND_FLOOR:
continue
var tile_type_str: String = tile_data.type
@@ -25,6 +25,16 @@ func after_test() -> void:
_instance = null
# -------------------------------------------------------------------------
# D-076: Layout constants
# -------------------------------------------------------------------------
func test_dialogue_max_width_matches_d076() -> void:
# D-076 (OQ-29): DIALOGUE_MAX_WIDTH must be 640px. Regression guard — was
# incorrectly set to 1200 before review round 1.
assert_that(Constants.DIALOGUE_MAX_WIDTH).is_equal(640)
# -------------------------------------------------------------------------
# D-049: Z-layer scene hierarchy
# -------------------------------------------------------------------------