Level reset cheat: fix object respawn issue

This commit is contained in:
Benjamin Levy 2020-08-16 19:28:59 -04:00
parent 36b08eab1b
commit 4e4c307c83
No known key found for this signature in database
GPG Key ID: AAB1132642EF3045
1 changed files with 13 additions and 0 deletions

View File

@ -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;