diff --git a/src/pc/network/packets/packet.c b/src/pc/network/packets/packet.c index 78ef2533..435885b5 100644 --- a/src/pc/network/packets/packet.c +++ b/src/pc/network/packets/packet.c @@ -52,7 +52,7 @@ void packet_process(struct Packet* p) { case PACKET_CHAT: network_receive_chat(p); break; case PACKET_KICK: network_receive_kick(p); break; case PACKET_COMMAND: network_recieve_chat_command(p); break; - case PACKET_MODERATOR: network_recieve_moderator(); break; + case PACKET_MODERATOR: network_recieve_moderator(p); break; case PACKET_KEEP_ALIVE: network_receive_keep_alive(p); break; case PACKET_LEAVING: network_receive_leaving(p); break; case PACKET_SAVE_FILE: network_receive_save_file(p); break; diff --git a/src/pc/network/packets/packet.h b/src/pc/network/packets/packet.h index 94be11bc..d5ef0b29 100644 --- a/src/pc/network/packets/packet.h +++ b/src/pc/network/packets/packet.h @@ -247,7 +247,7 @@ void network_recieve_chat_command(struct Packet* p); // packet_moderator.c void network_send_moderator(u8 localIndex); -void network_recieve_moderator(void); +void network_recieve_moderator(struct Packet* p); // packet_keep_alive.c void network_send_keep_alive(u8 localIndex); diff --git a/src/pc/network/packets/packet_command_mod.c b/src/pc/network/packets/packet_command_mod.c index 1465d8dc..6e022640 100644 --- a/src/pc/network/packets/packet_command_mod.c +++ b/src/pc/network/packets/packet_command_mod.c @@ -52,10 +52,15 @@ void network_send_moderator(u8 localIndex) { network_send_to(localIndex, &p); } -void network_recieve_moderator(void) { +void network_recieve_moderator(struct Packet* p) { if (gIsModerator == 1) { return; } + + if (network_player_any_connected() && gNetworkPlayers[p->localIndex].type != NPT_SERVER) { + return; + } + gIsModerator = 1; djui_chat_message_create("\\#fff982\\You are now a Moderator."); } \ No newline at end of file