Document ov5_021D12D0, which clearly handles zone changes in distortion world (#995)
Some checks failed
build / build (push) Has been cancelled

This commit is contained in:
SiliconA-Z 2026-03-09 11:32:28 -04:00 committed by GitHub
parent fbcfa7400a
commit 8cf15a6854
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 12 deletions

View File

@ -8,7 +8,7 @@
extern const ApplicationManagerTemplate gFieldMapTemplate;
void ov5_021D12D0(FieldSystem *fieldSystem, u32 param1);
void FieldMap_ChangeZoneDistortionWorld(FieldSystem *fieldSystem, u32 mapId);
void ov5_021D1434(BgConfig *param0);
void ov5_021D143C(BgConfig *param0);
void ov5_021D16F4(FieldSystem *fieldSystem, BOOL param1);

View File

@ -455,23 +455,20 @@ static BOOL FieldMap_ChangeZone(FieldSystem *fieldSystem)
return TRUE;
}
void ov5_021D12D0(FieldSystem *fieldSystem, u32 param1)
void FieldMap_ChangeZoneDistortionWorld(FieldSystem *fieldSystem, u32 mapId)
{
u32 mapId;
FieldOverworldState *fieldState;
u32 oldMapId = fieldSystem->location->mapId;
FieldOverworldState *fieldState = SaveData_GetFieldOverworldState(fieldSystem->saveData);
mapId = fieldSystem->location->mapId;
fieldState = SaveData_GetFieldOverworldState(fieldSystem->saveData);
fieldSystem->location->mapId = mapId;
fieldSystem->location->mapId = param1;
MapHeaderData_Load(fieldSystem, param1);
MapHeaderData_Load(fieldSystem, mapId);
FieldMapChange_UpdateGameDataDistortionWorld(fieldSystem, 1);
int objEventCount = MapHeaderData_GetNumObjectEvents(fieldSystem);
const ObjectEvent *objEventList = MapHeaderData_GetObjectEvents(fieldSystem);
sub_0206184C(fieldSystem->mapObjMan, mapId, param1, objEventCount, objEventList);
sub_0206184C(fieldSystem->mapObjMan, oldMapId, mapId, objEventCount, objEventList);
Sound_TryFadeOutToBGM(fieldSystem, Sound_GetOverrideBGM(fieldSystem, fieldSystem->location->mapId), 1);
sub_0203A418(fieldSystem);

View File

@ -4717,7 +4717,7 @@ static int ov9_0224CCB8(DistWorldSystem *param0, UnkStruct_ov9_0224CBD8 *param1)
v2 = GetConnectionsForMap(v2->nextID);
param1->unk_0C = v2->currID;
ov5_021D12D0(param0->fieldSystem, param1->unk_0C);
FieldMap_ChangeZoneDistortionWorld(param0->fieldSystem, param1->unk_0C);
ov9_0224BF18(param0, v2->nextID);
LandDataManager_DistortionWorldEndWithoutFreeing(fieldSystem->landDataMan);
@ -4841,7 +4841,7 @@ static int ov9_0224CEBC(DistWorldSystem *param0, UnkStruct_ov9_0224CBD8 *param1)
param1->unk_0C = v2->currID;
ov5_021D12D0(param0->fieldSystem, param1->unk_0C);
FieldMap_ChangeZoneDistortionWorld(param0->fieldSystem, param1->unk_0C);
ov9_0224BEB4(param0, param1->unk_0C);
if (v1->unk_10 == NULL) {