File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -679,20 +679,15 @@ SailCollide:
679679 SR16 h , l , 3
680680 ld e , l
681681 ld d , h ; de = ty
682- push bc
683- push de
682+ ld a , d
683+ ld [ wGRrowH ], a ; WorldTile stores only ty's low byte
684684 call WorldTile
685- pop de
686- pop bc
687685 cp TILE_SAND
688686 ret c ; water: keep sailing
689687 ; a port district's shore is a dock, not a rock (the same district
690- ; hash that draws the dock planks): stop the ship, spare the hull
691- SR16 b , c , 2
692- ld b , c ; dx = tx / 4
693- SR16 d , e , 2
694- ld c , e ; dy = ty / 4
695- call HasPortHash
688+ ; hash that draws the dock planks): stop the ship, spare the hull.
689+ ; WorldTile left the tile coords in wWX/wGRrow for DockTileIfPort.
690+ call DockTileIfPort ; a = TILE_DOCK iff a port district
696691 ld c , a ; survives the revert below (a-only)
697692 ld a , [ wOldPosX ]
698693 ld [ wPosX ], a
@@ -707,8 +702,8 @@ SailCollide:
707702 ld [ wVelY ], a
708703 call ComputeShipPx
709704 ld a , c
710- and a
711- ret nz ; docking bump: no damage
705+ cp TILE_DOCK
706+ ret z ; docking bump: no damage
712707 ; hull damage (with cooldown)
713708 ld a , [ wDmgCool ]
714709 and a
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ wFX: db
3737wFY: db
3838wWX:: dw ; current tile x (generation/detail)
3939wGRrow:: db ; current tile y (low byte; detail hash)
40- wGRrowH: db ; current tile y, high byte (world rows 256-287)
40+ wGRrowH:: db ; current tile y, high byte (world rows 256-287)
4141wH00: db
4242wH10: db
4343wH01: db
@@ -304,7 +304,7 @@ TileAttr:
304304; in: a = TILE_SAND (a beach tile at wWX/wGRrow); out: a = TILE_DOCK if the
305305; tile's 4x4 district is a port district, else TILE_SAND. Pure function of
306306; seed+coords, so streamed and redrawn tiles always agree. clobbers all.
307- DockTileIfPort:
307+ DockTileIfPort::
308308 ld a , [ wWX ]
309309 ld l , a
310310 ld a , [ wWX + 1 ]
You can’t perform that action at this time.
0 commit comments