mirror of
https://github.com/minetest/minetest.git
synced 2024-12-02 04:23:45 +01:00
Move setlocale
from Lua to C++.
This commit is contained in:
parent
880a25c921
commit
bb28afcfc3
@ -21,7 +21,6 @@ if core.print then
|
|||||||
core.print = nil -- don't pollute our namespace
|
core.print = nil -- don't pollute our namespace
|
||||||
end
|
end
|
||||||
math.randomseed(os.time())
|
math.randomseed(os.time())
|
||||||
os.setlocale("C", "numeric")
|
|
||||||
minetest = core
|
minetest = core
|
||||||
|
|
||||||
-- Load other files
|
-- Load other files
|
||||||
@ -47,7 +46,6 @@ elseif INIT == "mainmenu" then
|
|||||||
elseif INIT == "async" then
|
elseif INIT == "async" then
|
||||||
dofile(asyncpath .. "init.lua")
|
dofile(asyncpath .. "init.lua")
|
||||||
elseif INIT == "client" then
|
elseif INIT == "client" then
|
||||||
os.setlocale = nil
|
|
||||||
dofile(clientpath .. "init.lua")
|
dofile(clientpath .. "init.lua")
|
||||||
else
|
else
|
||||||
error(("Unrecognized builtin initialization type %s!"):format(tostring(INIT)))
|
error(("Unrecognized builtin initialization type %s!"):format(tostring(INIT)))
|
||||||
|
@ -119,6 +119,9 @@ ScriptApiBase::ScriptApiBase() :
|
|||||||
|
|
||||||
m_environment = NULL;
|
m_environment = NULL;
|
||||||
m_guiengine = NULL;
|
m_guiengine = NULL;
|
||||||
|
|
||||||
|
// Make sure Lua uses the right locale
|
||||||
|
setlocale(LC_NUMERIC, "C");
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptApiBase::~ScriptApiBase()
|
ScriptApiBase::~ScriptApiBase()
|
||||||
|
@ -250,8 +250,7 @@ void ScriptApiSecurity::initializeSecurityClient()
|
|||||||
"clock",
|
"clock",
|
||||||
"date",
|
"date",
|
||||||
"difftime",
|
"difftime",
|
||||||
"time",
|
"time"
|
||||||
"setlocale",
|
|
||||||
};
|
};
|
||||||
static const char *debug_whitelist[] = {
|
static const char *debug_whitelist[] = {
|
||||||
"getinfo",
|
"getinfo",
|
||||||
|
Loading…
Reference in New Issue
Block a user