From ed77a0bf554978387e089b7553dcb34b5e1c3eaf Mon Sep 17 00:00:00 2001 From: oilboi <47129783+oilboi@users.noreply.github.com> Date: Mon, 8 Jun 2020 01:49:26 -0400 Subject: [PATCH] Add in check to see if sender is server --- fire_handling.lua | 2 +- weather_handling.lua | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fire_handling.lua b/fire_handling.lua index d4a6cd1..c47e0e2 100644 --- a/fire_handling.lua +++ b/fire_handling.lua @@ -4,7 +4,7 @@ local fire_animation_timer = 0 local fire_animation_tile = 0 --receive the server states minetest.register_on_modchannel_message(function(channel_name, sender, message) - if channel_name == name..":fire_state" then + if sender == "" and channel_name == name..":fire_state" then on_fire = tonumber(message) end end) diff --git a/weather_handling.lua b/weather_handling.lua index 883a400..f4ad3e2 100644 --- a/weather_handling.lua +++ b/weather_handling.lua @@ -159,18 +159,16 @@ local function update_weather() end) end - - minetest.register_on_modchannel_message(function(channel_name, sender, message) --receive the initial packet which tells the client which nodes --to spawn weather columns on - if channel_name == "weather_nodes" then + if sender == "" and channel_name == "weather_nodes" then all_nodes = minetest.deserialize(message) do_effects = true weather:leave() --leave the channel end --receive the weather type - if channel_name == "weather_type" then + if sender == "" and channel_name == "weather_type" then if message == "1" then rain = false snow = true -- 2.44.0