Skip to content

Commit

Permalink
Some bug fixes related to sprites and objects
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaaaa123456789 authored and vulcandth committed Oct 16, 2022
1 parent c2b7ddb commit 51f4e3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions engine/battle_anims/anim_commands.asm
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,8 @@ BattleAnimCmd_ResetObp0:
ret

BattleAnimCmd_ClearObjs:
; BUG: BattleAnimCmd only clears the first 6⅔ objects (see docs/bugs_and_glitches.md)
ld hl, wActiveAnimObjects
ld a, $a0
ld a, NUM_ANIM_OBJECTS * BATTLEANIMSTRUCT_LENGTH
.loop
ld [hl], 0
inc hl
Expand Down
3 changes: 1 addition & 2 deletions engine/overworld/events.asm
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,12 @@ TryObjectEvent:
ld a, [hl]
and %00001111

; BUG: TryObjectEvent arbitrary code execution (see docs/bugs_and_glitches.md)
push bc
ld de, 3
ld hl, ObjectEventTypeArray
call IsInArray
jr nc, .nope
pop bc
jr nc, .nope

inc hl
ld a, [hli]
Expand Down
4 changes: 2 additions & 2 deletions engine/overworld/overworld.asm
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,6 @@ AddSpriteGFX:
ret

LoadSpriteGFX:
; BUG: LoadSpriteGFX does not limit the capacity of UsedSprites (see docs/bugs_and_glitches.md)

ld hl, wUsedSprites
ld b, SPRITE_GFX_LIST_CAPACITY
.loop
Expand All @@ -365,7 +363,9 @@ LoadSpriteGFX:
ret

.LoadSprite:
push bc
call GetSprite
pop bc
ld a, l
ret

Expand Down

0 comments on commit 51f4e3a

Please sign in to comment.