]> git.lizzy.rs Git - crafter_client.git/commitdiff
Upgrade back to 5.3.0-DEV since collision detection is fixed
authoroilboi <47129783+oilboi@users.noreply.github.com>
Fri, 17 Apr 2020 00:56:05 +0000 (20:56 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Fri, 17 Apr 2020 00:56:05 +0000 (20:56 -0400)
environment_effects.lua
player_input.lua
weather_handling.lua

index 0230ac08327fc49e7f02f0650d654ea4fe20b2f2..601789e6c266217fe7236f1d220009204399c172 100644 (file)
@@ -42,9 +42,7 @@ minetest.register_globalstep(function(dtime)
        if scary_sound_player_timer > 300 then
                scary_sound_player_timer = math.random(-120,0)
                pos.y = pos.y + 1.625
-               --save this for version 5.3.0
-               --local light = minetest.get_node_light(pos)
-               local light = 15
+               local light = minetest.get_node_light(pos)
                if pos.y < 0 and light <= 13 then
                        minetest.sound_play("scary_noise",{gain=0.4,pitch=math.random(70,100)/100})
                end     
@@ -59,14 +57,10 @@ minetest.register_globalstep(function(dtime)
                water_trickling_timer = 0
                local is_water_near = minetest.find_node_near(pos, 3, {"main:waterflow"})
                if is_water_near and not water_sound_handle then
-                       water_sound_handle = minetest.sound_play("stream", {loop=true,gain=0.1})
-                       --save this for version 5.3.0
-                       --minetest.sound_fade(water_sound_handle, 0.25, 0.1)
-                       --water_sound_handle = minetest.sound_play("stream", {loop=true,gain=0})
+                       minetest.sound_fade(water_sound_handle, 0.25, 0.1)
+                       water_sound_handle = minetest.sound_play("stream", {loop=true,gain=0})
                elseif not is_water_near and water_sound_handle then
-                       --save this for version 5.3.0
-                       --minetest.sound_fade(water_sound_handle, -0.25, 0)
-                       minetest.sound_stop(water_sound_handle)
+                       minetest.sound_fade(water_sound_handle, -0.25, 0)
                        water_sound_handle = nil
                end
        end
index fa9d2189709a7816c43dfc11e13be192589f3bf0..280ca943532631e37e147ce089dbbfbb94bc106a 100644 (file)
@@ -11,36 +11,6 @@ local old_sneak = false
 local bunny_hop = false
 local old_bunny_hop = false
 
---0 is nothing
---1 is up
---2 is down
---4 is left
---8 is right
---16 is jump
---32 is auxilary
---64 is sneak
---128 is left click
---256 is right click
-
---make the data from get_key_pressed usable
---Thanks Thou shalt use my mods!
-function minetest.get_control_bits(player)
-       local input = player:get_key_pressed()
-       local input_table = {}
-       --iterate through the table using the highest value first
-       local keys = {"rightclick","leftclick","sneak","aux","jump","right","left","down","up"}
-       for index,data in pairs(keys) do
-               local modifier = math.pow(2, 9-index)
-               if input >= modifier then
-                       input_table[data] = true
-                       input = input - modifier
-               else
-                       input_table[data] = false
-               end
-       end
-       return(input_table)
-end
-
 
 
 --attempt to tell the server to allow us to run
@@ -63,22 +33,17 @@ minetest.register_globalstep(function(dtime)
                return
        end
        
-       --save this for the 5.3.0 version
-       --local input = minetest.localplayer:get_control()
-       local input = minetest.get_control_bits(minetest.localplayer)
+       local input = minetest.localplayer:get_control()
        local vel = minetest.localplayer:get_velocity()
        local oldvel = minetest.localplayer:get_last_velocity()
        
        --cancel running if the player bumps into something
-       --save this for 5.3.0
-       --[[
        if running == true and ((vel.x == 0 and oldvel.x ~= 0) or (vel.z == 0 and oldvel.z ~= 0)) then
                running = false
                bunny_hop = false
                run_discharge_timer = 0
                state = 0
        end
-       ]]--
        
        --reset the run flag
        if running == true and (input.up == false or input.sneak == true or input.down == true) then
index 17a95bc49d9884887d599fdf58b70e28a6870711..d93ee57a1514882506d62f5cde7d5c9db3db0a52 100644 (file)
@@ -33,9 +33,7 @@ local spawn_snow = function(player)
                for z,y in pairs(x_index) do
                        if minetest.get_node_or_nil(vector.new(x,y+1,z)) ~= nil then
                                local pos = vector.new(x,y+1,z)
-                               --save this for 5.3.0
-                               --local lightlevel = minetest.get_node_light(pos, 0.5)
-                               local lightlevel = 15
+                               local lightlevel = minetest.get_node_light(pos, 0.5)
                                if lightlevel >= 14 then
                                        minetest.add_particlespawner({
                                                amount = 1,
@@ -90,9 +88,7 @@ local spawn_rain = function(player)
                for z,y in pairs(x_index) do
                        if minetest.get_node_or_nil(vector.new(x,y+1,z)) ~= nil then
                                local pos = vector.new(x,y+1,z)
-                               --save this for 5.3.0
-                               --local lightlevel = minetest.get_node_light(pos, 0.5)
-                               local lightlevel = 15
+                               local lightlevel = minetest.get_node_light(pos, 0.5)
                                if lightlevel >= 14 then
                                        minetest.add_particlespawner({
                                                amount = 1,