feat(walls): windows — see-through barrier, movement follows blocks_movement (#57)

- geometry.Wall carries the stored blocks_sight/blocks_movement switches; sight asks
  blocksSight, movement and the status rules ask blocks (open door passes both).
- worldmap translates both switches; moverules only pushes on a movement barrier.
- leakcheck and the tile oracle read blocks_sight independently.
- Walls/token-details/tiles groups prove both forms, sight-through, stuck, push and
  the locked-window open refusal; existing scenes stay byte-identical.

Ref #57

# Conflicts:
#	server/geometry.nim
#	server/world.nim
#	server/worldmap.nim
#	tools/leakcheck.nim
This commit is contained in:
2026-11-19 23:09:05 +01:00
parent cc566ee16e
commit e989100f50
9 changed files with 226 additions and 36 deletions
+13 -10
View File
@@ -279,16 +279,19 @@ proc setDoor*(sc: var Scene, id: int, open: bool, pushed: var seq[Push]): bool =
else:
sc.walls[id].open = false
let w = sc.walls[id]
for i in 0 ..< sc.tokens.len:
if not overlaps(sc, sc.tokens[i], w): continue
let (ok, p) = pushFrom(sc, sc.tokens[i], w)
if ok:
sc.tokens[i].prev = sc.tokens[i].pos; sc.tokens[i].hasPrev = true
sc.tokens[i].pos = p
sc.tokens[i].clearWalls() # a pushed token is clear of every blocking wall
pushed.add Push(ti: i, pos: p)
else:
sc.tokens[i].squeezedWalls = true
# Only a wall that blocks movement pushes: closing a see-through opening window is a solid
# barrier and pushes; a door whose movement switch is off (a custom shape) does not (#57).
if w.blocks:
for i in 0 ..< sc.tokens.len:
if not overlaps(sc, sc.tokens[i], w): continue
let (ok, p) = pushFrom(sc, sc.tokens[i], w)
if ok:
sc.tokens[i].prev = sc.tokens[i].pos; sc.tokens[i].hasPrev = true
sc.tokens[i].pos = p
sc.tokens[i].clearWalls() # a pushed token is clear of every blocking wall
pushed.add Push(ti: i, pos: p)
else:
sc.tokens[i].squeezedWalls = true
true
proc setDoor*(sc: var Scene, id: int, open: bool): bool =