From 5f60e7ff6a768af56c86b8120b4684d8bfd169fa Mon Sep 17 00:00:00 2001 From: drojf <1249449+drojf@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:44:36 +1100 Subject: [PATCH] Fix crash in CheckTipsAchievements() due to null Achievements.achievements - This fixes the longstanding Ch.8 bug "Extras menu locking itself after completion" bug - See https://github.com/07th-mod/matsuribayashi/issues/26 for more details - This fix can be applied to other applicable chapters as well (probably ch.7 onwards) in case it causes same problem there too --- .../Achievements.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Assets.Scripts.Core.SteamWorks/Achievements.cs b/Assets.Scripts.Core.SteamWorks/Achievements.cs index 01c6d432..58a4279e 100644 --- a/Assets.Scripts.Core.SteamWorks/Achievements.cs +++ b/Assets.Scripts.Core.SteamWorks/Achievements.cs @@ -8,7 +8,24 @@ namespace Assets.Scripts.Core.SteamWorks { public static class Achievements { - public static Achievement_t[] achievements; + private static Achievement_t[] _achievements; + + public static Achievement_t[] achievements + { + get + { + if(_achievements == null) + { + Load(); + } + + return _achievements; + } + set + { + _achievements = value; + } + } public static void Load() {