You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Fix WATERTILE/WALLTILE constants
WATRTILE was wrongly defined as 15, and WALLTILE as 1. Those had to be flipped around. This has allowed for us to replace inmediate values with these constants in several places to improve readability. WATRTILE was renamed to WATERTILE in the name of readability.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
LANDTILE EQU 0
|
||||
WALLTILE EQU 1
|
||||
WATRTILE EQU 15
|
||||
LANDTILE EQU 0
|
||||
WALLTILE EQU $f
|
||||
WATERTILE EQU 1
|
||||
|
||||
TALK EQU 1 << 4
|
||||
|
||||
|
@@ -76,7 +76,7 @@ Function6f07: ; 6f07
|
||||
ld a, [hl]
|
||||
ld d, a
|
||||
call GetTileCollision
|
||||
and a
|
||||
and a ; land
|
||||
jr z, Function6f3e
|
||||
scf
|
||||
ret
|
||||
@@ -89,7 +89,7 @@ Function6f2c: ; 6f2c
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
call GetTileCollision
|
||||
cp $1
|
||||
cp WATERTILE
|
||||
jr z, Function6f3e
|
||||
scf
|
||||
ret
|
||||
@@ -210,11 +210,11 @@ Function6fa1: ; 6fa1
|
||||
call GetCoordTile
|
||||
call GetTileCollision
|
||||
pop de
|
||||
and a
|
||||
and a ; land
|
||||
jr nz, .asm_6fd7
|
||||
call GetCoordTile
|
||||
call GetTileCollision
|
||||
and a
|
||||
and a ; land
|
||||
jr nz, .asm_6fd7
|
||||
xor a
|
||||
ret
|
||||
|
@@ -770,7 +770,7 @@ DoPlayerMovement:: ; 80000
|
||||
; Otherwise, return carry.
|
||||
|
||||
call GetTileCollision
|
||||
cp 1
|
||||
cp WATERTILE
|
||||
jr z, .Water
|
||||
|
||||
; Can walk back onto land from water.
|
||||
|
@@ -412,7 +412,7 @@ SurfFunction: ; c909
|
||||
jr z, .alreadyfail
|
||||
call GetFacingTileCoord
|
||||
call GetTileCollision
|
||||
cp $1
|
||||
cp WATERTILE
|
||||
jr nz, .cannotsurf
|
||||
call CheckDirection
|
||||
jr c, .cannotsurf
|
||||
@@ -549,7 +549,7 @@ TrySurfOW:: ; c9e7
|
||||
; Must be facing water.
|
||||
ld a, [EngineBuffer1]
|
||||
call GetTileCollision
|
||||
cp 1 ; surfable
|
||||
cp WATERTILE
|
||||
jr nz, .quit
|
||||
|
||||
; Check tile permissions.
|
||||
@@ -1522,7 +1522,7 @@ FishFunction: ; cf8e
|
||||
jr z, .fail
|
||||
call GetFacingTileCoord
|
||||
call GetTileCollision
|
||||
cp $1
|
||||
cp WATERTILE
|
||||
jr z, .facingwater
|
||||
.fail
|
||||
ld a, $3
|
||||
@@ -1769,7 +1769,7 @@ BikeFunction: ; d0b3
|
||||
|
||||
.ok
|
||||
call GetPlayerStandingTile
|
||||
and $f ; can't use our bike in a wall or on water
|
||||
and WALLTILE | WATERTILE ; can't use our bike in a wall or on water
|
||||
jr nz, .nope
|
||||
xor a
|
||||
ret
|
||||
|
@@ -84,7 +84,7 @@ GetPlayerStandingTile:: ; 184a
|
||||
CheckOnWater:: ; 1852
|
||||
ld a, [PlayerStandingTile]
|
||||
call GetTileCollision
|
||||
sub 1
|
||||
sub WATERTILE
|
||||
ret z
|
||||
and a
|
||||
ret
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user