Localize vector functions
parent
bd810e130b
commit
50e10cbfdf
4
init.lua
4
init.lua
|
@ -2,7 +2,7 @@ if not minetest.settings:get_bool("enable_weather") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local vmultiply, vadd = vector.multiply, vector.add
|
local vadd, vmultiply, vround = vector.add, vector.multiply, vector.round
|
||||||
local random = math.random
|
local random = math.random
|
||||||
local snow_covers = minetest.settings:get_bool("weather_snow_covers") ~= false
|
local snow_covers = minetest.settings:get_bool("weather_snow_covers") ~= false
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ local function process_player(player, current_downfall)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local ppos = vector.round(player:get_pos())
|
local ppos = vround(player:get_pos())
|
||||||
ppos.y = ppos.y + 1.5
|
ppos.y = ppos.y + 1.5
|
||||||
-- Higher than clouds
|
-- Higher than clouds
|
||||||
local cloud_height = player:get_clouds().height
|
local cloud_height = player:get_clouds().height
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local vmultiply, vadd = vector.multiply, vector.add
|
local vadd, vmultiply, vround = vector.add, vector.multiply, vector.round
|
||||||
|
|
||||||
local weather = {
|
local weather = {
|
||||||
type = "none",
|
type = "none",
|
||||||
|
@ -31,7 +31,7 @@ sscsm.every(0.09, function()
|
||||||
local current_downfall = weather.registered[weather.type]
|
local current_downfall = weather.registered[weather.type]
|
||||||
if current_downfall == nil then return end
|
if current_downfall == nil then return end
|
||||||
|
|
||||||
local ppos = vector.round(minetest.localplayer:get_pos())
|
local ppos = vround(minetest.localplayer:get_pos())
|
||||||
|
|
||||||
ppos.y = ppos.y + 1.5
|
ppos.y = ppos.y + 1.5
|
||||||
-- Higher than clouds
|
-- Higher than clouds
|
||||||
|
|
Loading…
Reference in New Issue