mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-12-10 01:52:29 +00:00
Fixed area desync
This commit is contained in:
parent
d6aa5531cc
commit
9ab1021f33
1 changed files with 7 additions and 6 deletions
|
|
@ -11,15 +11,16 @@ void network_send_sync_valid(struct NetworkPlayer* toNp, s16 courseNum, s16 actN
|
||||||
toNp->currLevelSyncValid = true;
|
toNp->currLevelSyncValid = true;
|
||||||
toNp->currAreaSyncValid = true;
|
toNp->currAreaSyncValid = true;
|
||||||
|
|
||||||
if (toNp == gNetworkPlayerLocal && !wasAreaSyncValid) {
|
|
||||||
network_player_update_course_level(toNp, courseNum, actNum, levelNum, areaIndex);
|
|
||||||
smlua_call_event_hooks(HOOK_ON_SYNC_VALID);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gNetworkType == NT_SERVER && toNp == gNetworkPlayerLocal) {
|
if (gNetworkType == NT_SERVER && toNp == gNetworkPlayerLocal) {
|
||||||
// the player is the server, no need to send sync valid
|
// the player is the server, no need to send sync valid
|
||||||
gNetworkAreaSyncing = false;
|
gNetworkAreaSyncing = false;
|
||||||
|
|
||||||
|
// call hooks
|
||||||
|
if (toNp == gNetworkPlayerLocal && !wasAreaSyncValid) {
|
||||||
|
network_player_update_course_level(toNp, courseNum, actNum, levelNum, (areaIndex != -1) ? areaIndex : toNp->currAreaIndex);
|
||||||
|
smlua_call_event_hooks(HOOK_ON_SYNC_VALID);
|
||||||
|
}
|
||||||
|
|
||||||
// but we do need to send level area inform
|
// but we do need to send level area inform
|
||||||
network_send_level_area_inform(toNp);
|
network_send_level_area_inform(toNp);
|
||||||
return;
|
return;
|
||||||
|
|
@ -68,7 +69,7 @@ void network_receive_sync_valid(struct Packet* p) {
|
||||||
np->currAreaSyncValid = true;
|
np->currAreaSyncValid = true;
|
||||||
|
|
||||||
if (np == gNetworkPlayerLocal && !wasAreaSyncValid) {
|
if (np == gNetworkPlayerLocal && !wasAreaSyncValid) {
|
||||||
network_player_update_course_level(np, courseNum, actNum, levelNum, areaIndex);
|
network_player_update_course_level(np, courseNum, actNum, levelNum, (areaIndex != -1) ? areaIndex : np->currAreaIndex);
|
||||||
smlua_call_event_hooks(HOOK_ON_SYNC_VALID);
|
smlua_call_event_hooks(HOOK_ON_SYNC_VALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue