mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 12:05:11 +00:00
Fix desync caused by players not knowing each others sync status
This commit is contained in:
parent
bb00d47cab
commit
06f801afe9
1 changed files with 13 additions and 0 deletions
|
@ -68,6 +68,9 @@ struct PacketPlayerData {
|
|||
u32 interactSyncID;
|
||||
u32 usedSyncID;
|
||||
u32 platformSyncID;
|
||||
|
||||
u8 levelSyncValid;
|
||||
u8 areaSyncValid;
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
|
@ -131,6 +134,10 @@ static void read_packet_data(struct PacketPlayerData* data, struct MarioState* m
|
|||
data->interactSyncID = interactSyncID;
|
||||
data->usedSyncID = usedSyncID;
|
||||
data->platformSyncID = platformSyncID;
|
||||
|
||||
struct NetworkPlayer* np = &gNetworkPlayers[m->playerIndex];
|
||||
data->areaSyncValid = np->currAreaSyncValid;
|
||||
data->levelSyncValid = np->currLevelSyncValid;
|
||||
}
|
||||
|
||||
static void write_packet_data(struct PacketPlayerData* data, struct MarioState* m,
|
||||
|
@ -187,6 +194,12 @@ static void write_packet_data(struct PacketPlayerData* data, struct MarioState*
|
|||
*interactSyncID = data->interactSyncID;
|
||||
*usedSyncID = data->usedSyncID;
|
||||
*platformSyncID = data->platformSyncID;
|
||||
|
||||
if (gNetworkType != NT_SERVER) {
|
||||
struct NetworkPlayer* np = &gNetworkPlayers[m->playerIndex];
|
||||
np->currAreaSyncValid = data->areaSyncValid;
|
||||
np->currLevelSyncValid = data->levelSyncValid;
|
||||
}
|
||||
}
|
||||
|
||||
void network_send_player(u8 localIndex) {
|
||||
|
|
Loading…
Reference in a new issue