mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-29 07:23:01 +00:00
Fix desync when changing areas
This commit is contained in:
parent
193f2cc447
commit
44a1831698
1 changed files with 7 additions and 3 deletions
|
@ -54,8 +54,11 @@ void sync_objects_update(void) {
|
||||||
while (entry) {
|
while (entry) {
|
||||||
struct SyncObjectForgetEntry* next = entry->next;
|
struct SyncObjectForgetEntry* next = entry->next;
|
||||||
if (entry->forgetTimer == FORGET_TIMEOUT) {
|
if (entry->forgetTimer == FORGET_TIMEOUT) {
|
||||||
|
struct SyncObject* currentSo = sync_object_get(entry->so->id);
|
||||||
|
if (currentSo == entry->so) {
|
||||||
hmap_del(sSoMap, entry->so->id);
|
hmap_del(sSoMap, entry->so->id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (entry->forgetTimer-- <= 0) {
|
if (entry->forgetTimer-- <= 0) {
|
||||||
if (prev) {
|
if (prev) {
|
||||||
|
@ -63,7 +66,7 @@ void sync_objects_update(void) {
|
||||||
} else {
|
} else {
|
||||||
sForgetList = next;
|
sForgetList = next;
|
||||||
}
|
}
|
||||||
//LOG_INFO("Freeing sync object... (%d)", entry->so->id);
|
//LOG_INFO("Freeing sync object %u : %s\n", entry->so->id, get_behavior_name_from_id(get_id_from_behavior(entry->so->behavior)));
|
||||||
free(entry->so);
|
free(entry->so);
|
||||||
free(entry);
|
free(entry);
|
||||||
|
|
||||||
|
@ -128,7 +131,8 @@ void sync_object_forget(u32 syncId) {
|
||||||
}
|
}
|
||||||
entry->next = newEntry;
|
entry->next = newEntry;
|
||||||
}
|
}
|
||||||
//LOG_INFO("Scheduling sync object to free... (%d)", so->id);
|
//LOG_INFO("Scheduling sync object to free %u : %s\n", so->id, get_behavior_name_from_id(get_id_from_behavior(so->behavior)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sync_object_forget_last_reliable_packet(u32 syncId) {
|
void sync_object_forget_last_reliable_packet(u32 syncId) {
|
||||||
|
|
Loading…
Reference in a new issue