mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-25 19:42:20 +00:00
Prevent transmission of player information when the player was in the main menu
This commit is contained in:
parent
59748737f1
commit
723a5cc46e
1 changed files with 4 additions and 0 deletions
|
|
@ -185,6 +185,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; }
|
||||
|
||||
struct PacketPlayerData data = { 0 };
|
||||
read_packet_data(&data, &gMarioStates[localIndex]);
|
||||
|
|
@ -202,6 +203,9 @@ void network_receive_player(struct Packet* p) {
|
|||
struct NetworkPlayer* np = network_player_from_global_index(globalIndex);
|
||||
if (np == NULL || np->localIndex == UNKNOWN_LOCAL_INDEX || !np->connected) { return; }
|
||||
|
||||
// prevent receiving a packet about our player
|
||||
if (gNetworkPlayerLocal && globalIndex == gNetworkPlayerLocal->globalIndex) { return; }
|
||||
|
||||
struct MarioState* m = &gMarioStates[np->localIndex];
|
||||
if (m == NULL || m->marioObj == NULL) { return; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue