mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
add a little explanation to l_get_builtin_path
This commit is contained in:
parent
1c610705e4
commit
f92a296c0d
1 changed files with 6 additions and 2 deletions
|
@ -285,10 +285,14 @@ int ModApiClient::l_get_privilege_list(lua_State *L)
|
||||||
int ModApiClient::l_get_builtin_path(lua_State *L)
|
int ModApiClient::l_get_builtin_path(lua_State *L)
|
||||||
{
|
{
|
||||||
std::string modname;
|
std::string modname;
|
||||||
if (getScriptApiBase(L)->getType() == ScriptingType::Client)
|
if (getScriptApiBase(L)->getType() == ScriptingType::Client) {
|
||||||
modname = BUILTIN_MOD_NAME;
|
modname = BUILTIN_MOD_NAME;
|
||||||
else if (getScriptApiBase(L)->getType() == ScriptingType::SSCSM)
|
} else if (getScriptApiBase(L)->getType() == ScriptingType::SSCSM) {
|
||||||
|
// get_builtin_path() is only called in builtin, so this is fine
|
||||||
modname = ScriptApiBase::getCurrentModNameInsecure(L);
|
modname = ScriptApiBase::getCurrentModNameInsecure(L);
|
||||||
|
if (modname != "*client_builtin*" && modname != "*server_builtin*")
|
||||||
|
modname = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (modname.empty())
|
if (modname.empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue