fix actor patching on room load

This commit is contained in:
gymnast86
2026-04-25 03:35:19 -07:00
parent dfe6d10c07
commit 7d9d398844
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1598,7 +1598,7 @@ static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_c
#if TARGET_PC
// If randomizer is active, override the data for this actor if it's in the actorPatches
if (randomizer_IsActive()) {
auto currentStageKey = getActorPatchesCurrentStageKey();
auto currentStageKey = getActorPatchesCurrentStageKey(i_actorPrm->room_no);
if (randomizer_GetContext().mActorPatches.contains(currentStageKey)) {
const auto& patches = randomizer_GetContext().mActorPatches.at(currentStageKey);
auto actorKey = getActorCRC32(i_actorData);
@@ -512,10 +512,10 @@ int randomizer_getItemAtLocation(const std::string& locationName) {
return randomizer_GetContext().mItemLocations[locationName];
}
u32 getActorPatchesCurrentStageKey() {
u32 getActorPatchesCurrentStageKey(u8 roomNo) {
u32 actorPatchesStageKey{};
actorPatchesStageKey |= getStageID(dComIfGp_getStartStageName()) << 16;
actorPatchesStageKey |= dComIfGp_getStartStageRoomNo() << 8;
actorPatchesStageKey |= roomNo << 8;
actorPatchesStageKey |= dComIfGp_getLayerNo();
return actorPatchesStageKey;
}
@@ -140,7 +140,7 @@ std::vector<u8> HexToBytes(std::string hex);
/*
* Gets the current stage id, room no, and layer no in the format for a key in mActorPatches
*/
u32 getActorPatchesCurrentStageKey();
u32 getActorPatchesCurrentStageKey(u8 roomNo);
class stage_actor_data_class;
/*