Skip to content

Commit

Permalink
Fix magic numbers in Celebi event code
Browse files Browse the repository at this point in the history
  • Loading branch information
Idain authored and mid-kid committed Jan 3, 2024
1 parent 804fa84 commit bbfb4ab
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions engine/events/celebi.asm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
cp 8 * 10 + 2
cp 10 * TILE_WIDTH + 2
jp nc, .FreezeCelebiPosition
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
Expand All @@ -159,9 +159,9 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 11 + 4
cp 11 * TILE_WIDTH + 4
jr nc, .ShiftY
cp 8 * 8 + 4
cp 8 * TILE_WIDTH + 4
jr nc, .ReinitSpriteAnimFrame
.ShiftY:
pop af
Expand All @@ -171,15 +171,15 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 10
cp 10 * TILE_WIDTH
jr c, .float_up
jr .float_down

.moving_left
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 10
cp 10 * TILE_WIDTH
jr nc, .float_up
.float_down
ld hl, SPRITEANIMSTRUCT_YCOORD
Expand All @@ -200,9 +200,9 @@ UpdateCelebiPosition:
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
add [hl]
cp 8 * 10
cp 10 * TILE_WIDTH
jr c, .left
cp -(8 * 3 + 2)
cp -(3 * TILE_WIDTH + 2)
jr nc, .left
ld hl, SPRITEANIMSTRUCT_FRAMESET_ID
add hl, bc
Expand Down

0 comments on commit bbfb4ab

Please sign in to comment.