typo for variable player(s); adding settingtypes
This commit is contained in:
parent
e4cba409e4
commit
b77661ce9d
15
init.lua
15
init.lua
@ -5,24 +5,25 @@ level, max gravity at sea level.
|
|||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
|
local action_timer = 0
|
||||||
|
local realgthres=minetest.settings:get('real_g_threshold') or 300
|
||||||
|
|
||||||
local update = function()
|
local gravity_update = function()
|
||||||
for _, players in ipairs(minetest.get_connected_players()) do
|
for _, players in ipairs(minetest.get_connected_players()) do
|
||||||
local pos = player:get_pos()
|
local pos = players:get_pos()
|
||||||
local grav = 1
|
local grav = 1
|
||||||
if pos.y > 300 then grav = 300/pos.y end
|
if pos.y > realgthres then grav = realgthres/pos.y end
|
||||||
if pos.y < -300 then grav = -300/pos.y end
|
if pos.y < (-1)*realgthres then grav = -1*realgthres/pos.y end
|
||||||
player:set_physics_override({gravity=grav})
|
players:set_physics_override({gravity=grav})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local action_timer = 0
|
|
||||||
|
|
||||||
local function gravity_globaltimer(dtime)
|
local function gravity_globaltimer(dtime)
|
||||||
action_timer = action_timer + dtime
|
action_timer = action_timer + dtime
|
||||||
|
|
||||||
if action_timer > 4 then
|
if action_timer > 4 then
|
||||||
update()
|
gravity_update()
|
||||||
action_timer = 0
|
action_timer = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
1
settingtypes.txt
Normal file
1
settingtypes.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
real_g_threshold (Threshold for activating real_g) int 300
|
Loading…
x
Reference in New Issue
Block a user