Invalidate area/level sync when unloading the area/level

This commit is contained in:
MysterD 2021-08-03 23:58:17 -07:00
parent 78f10d582c
commit 3a6da10d1a
1 changed files with 11 additions and 0 deletions

View File

@ -193,6 +193,12 @@ void load_obj_warp_nodes(void) {
} }
void clear_areas(void) { void clear_areas(void) {
struct NetworkPlayer* np = gNetworkPlayerLocal;
if (np != NULL) {
np->currAreaSyncValid = false;
np->currLevelSyncValid = false;
}
s32 i; s32 i;
gCurrentArea = NULL; gCurrentArea = NULL;
@ -261,6 +267,11 @@ void load_area(s32 index) {
} }
void unload_area(void) { void unload_area(void) {
struct NetworkPlayer* np = gNetworkPlayerLocal;
if (np != NULL) {
np->currAreaSyncValid = false;
}
network_clear_sync_objects(); network_clear_sync_objects();
if (gCurrentArea != NULL) { if (gCurrentArea != NULL) {
unload_objects_from_area(0, gCurrentArea->index); unload_objects_from_area(0, gCurrentArea->index);