peasant: be sure not to mess with state if loading from savegame

This commit is contained in:
Vince Weaver 2022-01-07 23:24:33 -05:00
parent 467d1f5bef
commit bc106806ab
8 changed files with 27 additions and 9 deletions

View File

@ -216,6 +216,9 @@ just_go_there:
;************************
level_over:
cmp #NEW_FROM_LOAD ; see if loading save game
beq exiting_cliff
; new location
; in theory this can only be TROGDOR
@ -227,7 +230,7 @@ level_over:
lda #0
sta PEASANT_XADD
sta PEASANT_YADD
exiting_cliff:
rts

View File

@ -256,6 +256,8 @@ oops_new_location:
;========================
level_over:
; NOTE: check for load from savegame if modify game state
rts

View File

@ -329,6 +329,11 @@ oops_new_location:
; exit level
;========================
level_over:
cmp #NEW_FROM_LOAD ; skip ahead if load from disk
beq really_level_over
lda MAP_LOCATION
cmp #LOCATION_OUTSIDE_INN
bne really_level_over

View File

@ -491,7 +491,7 @@ load_loop:
cpx #(END_OF_SAVE-WHICH_LOAD+1)
bne load_loop
lda #NEW_FROM_DISK ; load whole level from disk
lda #NEW_FROM_LOAD ; load whole level from disk
sta LEVEL_OVER
done_load:

View File

@ -423,7 +423,7 @@ no_draw_gary_flies:
lda LEVEL_OVER
bmi oops_new_location
bne game_over
bne level_over
; delay
@ -459,7 +459,7 @@ at_old_well:
lda #NEW_FROM_DISK ; needed?
sta LEVEL_OVER
jmp game_over
jmp level_over
skip_level_specific:
@ -470,7 +470,8 @@ skip_level_specific:
;************************
; exit level
;************************
game_over:
level_over:
; note: check reason for load if changing gamestate
rts

View File

@ -353,6 +353,8 @@ oops_new_location:
; exit level
;========================
level_over:
cmp #NEW_FROM_LOAD ; skip to end if loading save game
bne really_level_over
; specical case if going outside inn
; we don't want to end up behind inn

View File

@ -226,7 +226,7 @@ game_loop:
lda LEVEL_OVER
bmi oops_new_location
bne game_over
bne level_over
;=====================
; always draw peasant
@ -279,7 +279,10 @@ oops_new_location:
;************************
; exit level
;************************
game_over:
level_over:
; FIXME: check for load from savegame if modifying game state
rts

View File

@ -333,7 +333,7 @@ not_ned_cottage:
lda LEVEL_OVER
bmi oops_new_location
bne game_over
bne level_over
; delay
@ -351,7 +351,9 @@ oops_new_location:
;************************
; exit level
;************************
game_over:
level_over:
; note: check for load from savegame if change state
rts