lua: added LUA_VERSION global
Dieser Commit ist enthalten in:
Ursprung
c290837d33
Commit
b6ec6cc8bd
@ -95,6 +95,11 @@ SandboxPtr Sandbox::create(Script& script)
|
|||||||
lua_pushstring(L, TRAINTASTIC_CODENAME);
|
lua_pushstring(L, TRAINTASTIC_CODENAME);
|
||||||
lua_setfield(L, -2, "CODENAME");
|
lua_setfield(L, -2, "CODENAME");
|
||||||
|
|
||||||
|
// set LUA_VERSION
|
||||||
|
const std::string_view ident{lua_ident};
|
||||||
|
push(L, ident.substr(13, ident.find('$', 13) - 14));
|
||||||
|
lua_setfield(L, -2, "LUA_VERSION");
|
||||||
|
|
||||||
// add world:
|
// add world:
|
||||||
push(L, std::static_pointer_cast<::Object>(script.world().lock()));
|
push(L, std::static_pointer_cast<::Object>(script.world().lock()));
|
||||||
lua_setfield(L, -2, "world");
|
lua_setfield(L, -2, "world");
|
||||||
|
|||||||
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren