jak2 pckernel: save pc-settings on cheat progress and regular auto-saves (#3396)

Fixes #3392
This commit is contained in:
ManDude 2024-03-04 02:10:03 +00:00 committed by GitHub
parent 258fd75cd6
commit 7b926b5283
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 6 deletions

View file

@ -2304,6 +2304,8 @@ auto-save-post
(defun auto-save-user () (defun auto-save-user ()
(case *kernel-boot-message* (case *kernel-boot-message*
(('play 'preview) (('play 'preview)
(#when PC_PORT
(pc-settings-save))
(auto-save-command 'auto-save 0 0 *default-pool* #f) (auto-save-command 'auto-save 0 0 *default-pool* #f)
) )
) )

View file

@ -640,6 +640,11 @@
;; check unlocked cheats ;; check unlocked cheats
;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;
(let ((old (-> *pc-settings* cheats))
(old-unlocked (-> *pc-settings* cheats-unlocked))
(old-purchased (-> *pc-settings* cheats-purchased))
(old-revealed (-> *pc-settings* cheats-revealed)))
(dotimes (i (-> *pc-cheats-list* length)) (dotimes (i (-> *pc-cheats-list* length))
;; reveals cheats if they have been purchased, purchases cheats if they have been unlocked, unlocks cheats if they have been enabled. ;; reveals cheats if they have been purchased, purchases cheats if they have been unlocked, unlocks cheats if they have been enabled.
@ -669,6 +674,13 @@
) )
))) )))
(when (or (!= old (-> *pc-settings* cheats))
(!= old-unlocked (-> *pc-settings* cheats-unlocked))
(!= old-purchased (-> *pc-settings* cheats-purchased))
(!= old-revealed (-> *pc-settings* cheats-revealed)))
;; save pc-settings if we made new progress
(pc-settings-save)))
0) 0)