From 4e4c307c83a972a019b4bf55f1eb5231b7915d1c Mon Sep 17 00:00:00 2001 From: Benjamin Levy Date: Sun, 16 Aug 2020 19:28:59 -0400 Subject: [PATCH] Level reset cheat: fix object respawn issue --- src/game/object_list_processor.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c index 7113e7c8..6150351a 100644 --- a/src/game/object_list_processor.c +++ b/src/game/object_list_processor.c @@ -19,6 +19,7 @@ #include "platform_displacement.h" #include "profiler.h" #include "spawn_object.h" +#include "pc/cheats.h" /** @@ -409,6 +410,18 @@ void set_object_respawn_info_bits(struct Object *obj, u8 bits) { u32 *info32; u16 *info16; + /* Level reset cheat */ + /* + * Force objects to respawn on level reset + * + * NOTE: This forces objects to respawn in cases where they wouldn't with + * the cheat disabled. The GameShark code also has this problem. + */ + if (Cheats.LevelReset && Cheats.EnableCheats) { + return; + } + /* End of level reset cheat */ + switch (obj->respawnInfoType) { case RESPAWN_INFO_TYPE_32: info32 = (u32 *) obj->respawnInfo;