This commit is contained in:
sekta 2024-07-31 17:44:25 +04:00
parent bee4421ce9
commit 509db9790d
2 changed files with 19 additions and 36 deletions

View File

@ -69,21 +69,6 @@ console.add_command(
end
)
local function FormattedTime(seconds, format ) -- from gmod
if not seconds then seconds = 0 end
local hours = math.floor(seconds / 3600)
local minutes = math.floor((seconds / 60) % 60)
local millisecs = (seconds - math.floor(seconds)) * 100
seconds = math.floor(seconds % 60)
if format then
return string.format(format, minutes, seconds, millisecs)
else
return {h = hours, m = minutes, s = seconds, ms = millisecs}
end
end
console.add_command(
"time.uptime",
"Get time elapsed since the engine started",
@ -91,7 +76,7 @@ console.add_command(
local uptime = time.uptime()
local formatted_uptime = ""
local t = FormattedTime(uptime)
local t = string.formatted_time(uptime)
formatted_uptime = t.h .. "h " .. t.m .. "m " .. t.s .. "s"

View File

@ -285,25 +285,7 @@ entities.get_all = function(uids)
end
end
math.randomseed(time.uptime()*1536227939)
-- --------- Deprecated functions ------ --
block_index = block.index
block_name = block.name
blocks_count = block.defs_count
is_solid_at = block.is_solid_at
is_replaceable_at = block.is_replaceable_at
set_block = block.set
get_block = block.get
get_block_X = block.get_X
get_block_Y = block.get_Y
get_block_Z = block.get_Z
get_block_states = block.get_states
set_block_states = block.set_states
get_block_rotation = block.get_rotation
set_block_rotation = block.set_rotation
get_block_user_bits = block.get_user_bits
set_block_user_bits = block.set_user_bits
math.randomseed(time.uptime() * 1536227939)
----------------------------------------------
@ -444,7 +426,23 @@ function string.ends_with(str, endStr)
return endStr == "" or string.sub(str, -string.len(endStr)) == endStr
end
----------------------------------------------
-- --------- Deprecated functions ------ --
block_index = block.index
block_name = block.name
blocks_count = block.defs_count
is_solid_at = block.is_solid_at
is_replaceable_at = block.is_replaceable_at
set_block = block.set
get_block = block.get
get_block_X = block.get_X
get_block_Y = block.get_Y
get_block_Z = block.get_Z
get_block_states = block.get_states
set_block_states = block.set_states
get_block_rotation = block.get_rotation
set_block_rotation = block.set_rotation
get_block_user_bits = block.get_user_bits
set_block_user_bits = block.set_user_bits
function load_script(path, nocache)
on_deprecated_call("load_script")