Make sure overworld sprites don't appear after returning from overworld [bugfix] (#17)

This commit is contained in:
xCrystal 2023-10-21 19:29:29 +02:00
parent e9ad1f5612
commit 89a17c3a05
2 changed files with 9 additions and 14 deletions

View File

@ -130,6 +130,7 @@ GameMenu_WorldMap:
farcall OverworldLoop
; return from overworld loop
call ClearObjectStructs
call ClearBGPalettes
call ClearSprites
farcall AutoSaveGameOutsideOverworld

View File

@ -551,7 +551,7 @@ ReadBGEvents::
ReadObjectEvents::
push hl
call ClearObjectStructs
call ClearNonPlayerObjectStructs
pop de
ld hl, wMap1Object
ld a, [de]
@ -618,22 +618,16 @@ CopyMapObjectEvents::
ret
ClearObjectStructs::
ld hl, wObjectStructs
ld bc, OBJECT_LENGTH * NUM_OBJECT_STRUCTS
xor a
jp ByteFill
ClearNonPlayerObjectStructs::
ld hl, wObject1Struct
ld bc, OBJECT_LENGTH * (NUM_OBJECT_STRUCTS - 1)
xor a
call ByteFill
; Just to make sure (this is rather pointless)
ld hl, wObject1Struct
ld de, OBJECT_LENGTH
ld c, NUM_OBJECT_STRUCTS - 1
xor a
.loop
ld [hl], a
add hl, de
dec c
jr nz, .loop
ret
jp ByteFill
GetWarpDestCoords::
call GetMapScriptsBank