mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-26 03:51:46 +00:00
Prevent sending object-related packets until the area is synchronized
This commit is contained in:
parent
fecba91c5e
commit
58914e993f
5 changed files with 5 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ static struct Object* find_nearest_coin(const BehaviorScript *behavior, f32* pos
|
|||
}
|
||||
|
||||
void network_send_collect_coin(struct Object* o) {
|
||||
if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { return; }
|
||||
u16 behaviorId = get_id_from_behavior(o->behavior);
|
||||
|
||||
struct Packet p;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ static struct Object* find_nearest_item(const BehaviorScript *behavior, f32* pos
|
|||
}
|
||||
|
||||
void network_send_collect_item(struct Object* o) {
|
||||
if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { return; }
|
||||
u16 behaviorId = get_id_from_behavior(o->behavior);
|
||||
|
||||
struct Packet p;
|
||||
|
|
|
|||
|
|
@ -411,6 +411,7 @@ void network_send_object(struct Object* o) {
|
|||
}
|
||||
|
||||
void network_send_object_reliability(struct Object* o, bool reliable) {
|
||||
if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { return; }
|
||||
// prevent sending objects during credits sequence
|
||||
if (gCurrActStarNum == 99) { return; }
|
||||
// sanity check SyncObject
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ static void write_packet_data(struct PacketPlayerData* data, struct MarioState*
|
|||
void network_send_player(u8 localIndex) {
|
||||
if (gMarioStates[localIndex].marioObj == NULL) { return; }
|
||||
if (gDjuiInMainMenu) { return; }
|
||||
if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { return; }
|
||||
|
||||
struct PacketPlayerData data = { 0 };
|
||||
read_packet_data(&data, &gMarioStates[localIndex]);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ void network_send_spawn_objects(struct Object* objects[], u32 models[], u8 objec
|
|||
}
|
||||
|
||||
void network_send_spawn_objects_to(u8 sendToLocalIndex, struct Object* objects[], u32 models[], u8 objectCount) {
|
||||
if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { return; }
|
||||
assert(objectCount < MAX_SPAWN_OBJECTS_PER_PACKET);
|
||||
// prevent sending spawn objects during credits
|
||||
if (gCurrActStarNum == 99) { return; }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue