Change us_time calls to gametime.
This commit is contained in:
parent
2b8b604162
commit
11c4a7d7d0
3 changed files with 6 additions and 6 deletions
6
abms.lua
6
abms.lua
|
@ -1,7 +1,7 @@
|
|||
-- see also, fungal_tree.lua
|
||||
|
||||
-- player surface damage and hunger
|
||||
local dps_delay = 3000000
|
||||
local dps_delay = 3
|
||||
|
||||
local last_dps_check = 0
|
||||
local cold_delay = 5
|
||||
|
@ -42,7 +42,7 @@ spike_soil['fun_caves:black_sand'] = true
|
|||
-- all the fun_caves globalstep functions
|
||||
------------------------------------------------------------
|
||||
minetest.register_globalstep(function(dtime)
|
||||
local time = minetest.get_us_time()
|
||||
local time = minetest.get_gametime()
|
||||
|
||||
-- Execute only after an interval.
|
||||
if last_dps_check and time - last_dps_check < dps_delay then
|
||||
|
@ -170,7 +170,7 @@ minetest.register_globalstep(function(dtime)
|
|||
dps_count = hunger_delay
|
||||
end
|
||||
|
||||
last_dps_check = minetest.get_us_time()
|
||||
last_dps_check = minetest.get_gametime()
|
||||
dps_count = dps_count - 1
|
||||
end)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ local function armor(user, factor)
|
|||
user:set_armor_groups({fleshy=factor})
|
||||
--print(dump(user:get_armor_groups()))
|
||||
minetest.chat_send_player(player_name, 'Your skin feels harder...')
|
||||
fun_caves.armor_expire[player_name] = minetest.get_us_time() + (3600 * 1000000)
|
||||
fun_caves.armor_expire[player_name] = minetest.get_gametime() + 3600
|
||||
end
|
||||
|
||||
local descs = {
|
||||
|
|
4
chat.lua
4
chat.lua
|
@ -10,9 +10,9 @@ minetest.register_chatcommand("armor", {
|
|||
for group, value in pairs(armor) do
|
||||
minetest.chat_send_player(name, " "..group.." "..value)
|
||||
end
|
||||
--print(math.floor(minetest.get_us_time() / (60 * 1000000)))
|
||||
print(math.floor(minetest.get_gametime() / 60))
|
||||
if fun_caves.armor_expire and fun_caves.armor_expire[name] then
|
||||
local min = math.floor((fun_caves.armor_expire[name] - minetest.get_us_time()) / (60 * 1000000))
|
||||
local min = math.floor((fun_caves.armor_expire[name] - minetest.get_gametime()) / 60)
|
||||
minetest.chat_send_player(name, "Your elixir will expire in "..min..' minutes.')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue