https://github.com/Attacktive/nyan-wanderer/blob/25c8379a4fb8974d015f130ede60ea73b6f7158e/package/contents/ui/main.qml#L43-L57 (state variables at https://github.com/Attacktive/nyan-wanderer/blob/25c8379a4fb8974d015f130ede60ea73b6f7158e/package/contents/ui/main.qml#L22-L25)
The wasIdleBefore flag does not really track "was idle before" — it is set true on the first move and only reset by idleTimer, so it effectively means "this is not the first move, and we did not just finish idling." Inside the idle branch it is also re-assigned wasIdleBefore = true even though the guard already requires it to be true (a dead assignment).
The behavior is probably intended (do not idle on the very first move; do not idle twice in a row), but the naming and the redundant write make it hard to follow.
Suggested fix: rename to something like hasMovedOnce / canIdle, drop the redundant assignment, and add a short comment on the intent.
https://github.com/Attacktive/nyan-wanderer/blob/25c8379a4fb8974d015f130ede60ea73b6f7158e/package/contents/ui/main.qml#L43-L57 (state variables at https://github.com/Attacktive/nyan-wanderer/blob/25c8379a4fb8974d015f130ede60ea73b6f7158e/package/contents/ui/main.qml#L22-L25)
The
wasIdleBeforeflag does not really track "was idle before" — it is set true on the first move and only reset byidleTimer, so it effectively means "this is not the first move, and we did not just finish idling." Inside the idle branch it is also re-assignedwasIdleBefore = trueeven though the guard already requires it to be true (a dead assignment).The behavior is probably intended (do not idle on the very first move; do not idle twice in a row), but the naming and the redundant write make it hard to follow.
Suggested fix: rename to something like
hasMovedOnce/canIdle, drop the redundant assignment, and add a short comment on the intent.