RPG battleground: trackPointer uses Math.max so two pointermoves already block tile placement #1034

Closed
opened 2026-08-13 05:04:41 +00:00 by spikerj · 1 comment
Owner

RpgGameComponent.trackPointer increments movement with this.pointer_move = Math.max(this.pointer_move + 1, 100).

Math.max(..., 100) snaps the counter to 100 on the first pointermove and to 101 on the second. upPointer then treats pointer_move > 100 as a drag and refuses to changeTileType.

Intended behavior is almost certainly this.pointer_move += 1 (threshold 100 = ~100 move events before a click becomes a drag). As written, a two-event jitter while orbiting/clicking a tile never places.

Pinned by rpg-game.component.logic.spec.ts ("two pointermoves already exceed the click budget").

this.pointer_move = Math.max(this.pointer_move + 1, 100);
`RpgGameComponent.trackPointer` increments movement with `this.pointer_move = Math.max(this.pointer_move + 1, 100)`. `Math.max(..., 100)` snaps the counter to 100 on the first `pointermove` and to 101 on the second. `upPointer` then treats `pointer_move > 100` as a drag and refuses to `changeTileType`. Intended behavior is almost certainly `this.pointer_move += 1` (threshold 100 = ~100 move events before a click becomes a drag). As written, a two-event jitter while orbiting/clicking a tile never places. Pinned by `rpg-game.component.logic.spec.ts` ("two pointermoves already exceed the click budget"). ```ts this.pointer_move = Math.max(this.pointer_move + 1, 100); ```
Author
Owner

Already on master. RpgGameComponent.trackPointer already increments pointer_move by 1, so two pointermoves no longer snap past the click budget. Closing.

Already on `master`. RpgGameComponent.trackPointer already increments pointer_move by 1, so two pointermoves no longer snap past the click budget. Closing.
Sign in to join this conversation.