Corrected handling of obstruction and script flags on 2D map.

This commit is contained in:
Martin Haye 2015-05-07 06:54:43 -07:00
parent 329a7070ce
commit d4a550f760
2 changed files with 7 additions and 3 deletions

View File

@ -468,7 +468,11 @@ class PackPartitions
(0..<TILES_PER_ROW).each { colNum ->
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))
}
}

View File

@ -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