Assigning to GameClock.paused is silently discarded #118

Open
opened 2026-09-19 10:06:40 +01:00 by liamjd · 0 comments
Owner

test_pawn_task_arrival.gd opens with

func before_each() -> void:
	GameClock.paused = false

GameClock.paused is derived from player_paused and menu_paused and has only a getter. Assigning to it is not a parse error and not a runtime error — it is silently discarded. Verified with a throwaway test: set player_paused = true, assign paused = false, and paused is still true.

Harmless today, because those tests drive PawnView._process() directly and never ask the clock for anything. But it reads as "this test unpauses the clock first", and the next person to write a test that genuinely depends on the clock running will copy it and spend a while wondering why.

AC:

  • The line either does what it says (GameClock.player_paused = false, or reset()) or goes, with a note if the file has no reason to touch the clock at all
  • Consider whether a read-only derived property should push_error() on assignment rather than swallowing it — a setter that errors would have caught this at the point of writing. Same shape as Pawn.destination and any other derived state added later
`test_pawn_task_arrival.gd` opens with ```gdscript func before_each() -> void: GameClock.paused = false ``` `GameClock.paused` is derived from `player_paused` and `menu_paused` and has only a getter. Assigning to it is not a parse error and not a runtime error — it is silently discarded. Verified with a throwaway test: set `player_paused = true`, assign `paused = false`, and `paused` is still true. Harmless today, because those tests drive `PawnView._process()` directly and never ask the clock for anything. But it reads as "this test unpauses the clock first", and the next person to write a test that genuinely depends on the clock running will copy it and spend a while wondering why. AC: - The line either does what it says (`GameClock.player_paused = false`, or `reset()`) or goes, with a note if the file has no reason to touch the clock at all - Consider whether a read-only derived property should push_error() on assignment rather than swallowing it — a setter that errors would have caught this at the point of writing. Same shape as `Pawn.destination` and any other derived state added later
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder#118
No description provided.