I have the following Z80 asm code (from pokemon legacy crystal)
CheckOnWater::
ld a, [wPlayerStandingTile]
call GetTileCollision
sub WATER_TILE
ret z
and a
ret
i was wondering what the point is of
ret z
and a
ret
as i understand, sub WATER_TITLE
sets the z flag, it feels redundant to conditionally return, then and a
just to set the z flag again and then to return.
can’t i replace the whole three lines by just ret
?
what am i missing?