Randomizer: Fixes LACS and Prelude checks under certain conditions (#961)

* Prevents LACS flag from getting set when it shouldn't be.

* Fixes Prelude and LACS checks so they apply immediately if missed.

* Refactors the scene-flag-setting code into its own function.

* Renames new enums and props to be clearer and not specific to scene flags.

* Refactors pendingFlag data into a separate struct.
This commit is contained in:
Christopher Leggett 2022-07-31 21:57:30 -04:00 committed by GitHub
commit b59c9cdf02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 6 deletions

View file

@ -356,7 +356,20 @@ typedef struct {
/* 0x00 */ s32 active;
/* 0x04 */ Vec3f tip;
/* 0x10 */ Vec3f base;
} WeaponInfo; // size = 0x1C
} WeaponInfo; // size = 0x1C\
typedef enum {
FLAG_NONE,
FLAG_SCENE_SWITCH,
FLAG_SCENE_TREASURE,
FLAG_SCENE_CLEAR,
FLAG_SCENE_COLLECTIBLE,
} FlagType;
typedef struct {
/* 0x00 */ s32 flagID; // which flag to set when Player_SetPendingFlag is called
/* 0x04 */ FlagType flagType; // type of flag to set when Player_SetPendingFlag is called
} PendingFlag; // size = 0x06
#define PLAYER_STATE1_0 (1 << 0)
#define PLAYER_STATE1_1 (1 << 1)
@ -612,6 +625,7 @@ typedef struct Player {
/* 0x0A86 */ s8 unk_A86;
/* 0x0A87 */ u8 unk_A87;
/* 0x0A88 */ Vec3f unk_A88; // previous body part 0 position
} Player; // size = 0xA94
/* 0x0A94 */ PendingFlag pendingFlag;
} Player; // size = 0xAA0
#endif