You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-12-11 05:02:16 -08:00
Upkeep tasks in board menu: auto save game, increase turn, clear wTurnData (#11); also init wCurTurn and wCurSpace in EnterMap
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
BoardMenuScript::
|
||||
opentext
|
||||
callasm .Upkeep
|
||||
.display_menu
|
||||
callasm BoardMenu
|
||||
ifequal BOARDMENUITEM_DIE, .Die
|
||||
@@ -10,6 +11,17 @@ BoardMenuScript::
|
||||
closetext
|
||||
end
|
||||
|
||||
.Upkeep:
|
||||
; save after opentext to reanchor map first
|
||||
; save before processing variables like wCurTurn due to BoardMenuScript reentry after game reset
|
||||
farcall AutoSaveGameInOverworld
|
||||
ld hl, wCurTurn
|
||||
inc [hl]
|
||||
ld hl, wTurnData
|
||||
ld bc, wTurnDataEnd - wTurnData
|
||||
xor a
|
||||
jp ByteFill
|
||||
|
||||
.Die:
|
||||
callasm BoardMenu_Die
|
||||
iffalse BoardMenuScript
|
||||
|
||||
Reference in New Issue
Block a user