From d4a550f760c83ef734e4d1793fb3286254f89efd Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Thu, 7 May 2015 06:54:43 -0700 Subject: [PATCH] Corrected handling of obstruction and script flags on 2D map. --- .../tools/PackPartitions/src/org/demo/PackPartitions.groovy | 6 +++++- Platform/Apple/virtual/src/tile/tile.s | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Platform/Apple/tools/PackPartitions/src/org/demo/PackPartitions.groovy b/Platform/Apple/tools/PackPartitions/src/org/demo/PackPartitions.groovy index c0b745c4..cbffa429 100644 --- a/Platform/Apple/tools/PackPartitions/src/org/demo/PackPartitions.groovy +++ b/Platform/Apple/tools/PackPartitions/src/org/demo/PackPartitions.groovy @@ -468,7 +468,11 @@ class PackPartitions (0.. def x = hOff + colNum def tile = (row && x < width) ? row[x] : null - def flags = ([colNum, rowNum] in locationsWithTriggers) ? 0x20 : 0 + def flags = 0 + if ([colNum, rowNum] in locationsWithTriggers) + flags |= 0x20 + if (tile?.@obstruction == 'true') + flags |= 0x40 buf.put((byte)((tile ? tileMap[tile.@id] : 0) | flags)) } } diff --git a/Platform/Apple/virtual/src/tile/tile.s b/Platform/Apple/virtual/src/tile/tile.s index c1686ec8..a3eb0d5d 100644 --- a/Platform/Apple/virtual/src/tile/tile.s +++ b/Platform/Apple/virtual/src/tile/tile.s @@ -1286,7 +1286,7 @@ ADVANCE: !zone { JSR CALC LDA AVATAR_TILE ; get tile flags - AND #$20 ; obstructed? + AND #$40 ; obstructed? BEQ + ; Player moved to an obstructed place. Undo! @@ -1311,7 +1311,7 @@ ADVANCE: !zone { BEQ .ret INY ; moved LDA AVATAR_TILE - AND #$10 ; check script flag + AND #$20 ; check script flag BEQ .ret INY ; moved and also new place is scripted .ret RTS