]> git.lizzy.rs Git - crafter_client.git/commitdiff
Add in check to see if sender is server
authoroilboi <47129783+oilboi@users.noreply.github.com>
Mon, 8 Jun 2020 05:49:26 +0000 (01:49 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Mon, 8 Jun 2020 05:49:26 +0000 (01:49 -0400)
fire_handling.lua
weather_handling.lua

index d4a6cd1e8d7a7d993a15f1e205f9d7a8a197bf45..c47e0e257dfd195fc0f203f4ebde868eb0707f83 100644 (file)
@@ -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)
index 883a400aa803987ad0592938d4176f6d2b947b44..f4ad3e2c32233d0e7ccd5ead2dc9b94cbe7a3855 100644 (file)
@@ -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