Remove dead code in custom geo and bhv functions
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run

- Custom geo asm and custom behaviors were meant to use any non-local
  function from any active mod, but the condition for it was always
  false (gSmLuaConvertSuccess is never set to false and funcRef is not
  checked)
- By default, they should NOT be able to retrieve anything from other mods
- Even without this condition, they are still allowed to use any
  function exposed to _G

Approved by Isaac.
This commit is contained in:
PeachyPeachSM64 2026-05-01 12:51:36 +02:00
parent 793196d581
commit 58a6b7e019
2 changed files with 0 additions and 10 deletions

View file

@ -1004,12 +1004,6 @@ static s32 bhv_cmd_call_native_ext(void) {
gSmLuaConvertSuccess = true;
LuaFunction funcRef = smlua_get_function_mod_variable(modIndex, funcStr);
if (!gSmLuaConvertSuccess) {
gSmLuaConvertSuccess = true;
funcRef = smlua_get_any_function_mod_variable(funcStr);
}
if (!gSmLuaConvertSuccess || funcRef == 0) {
LOG_LUA("Failed to call lua behavior function, could not find lua function '%s'", funcStr);
gCurBhvCommand += 2;

View file

@ -890,10 +890,6 @@ Gfx *geo_process_lua_function(s32 callContext, struct GraphNode *node, UNUSED Ma
// Retrieve function ref
gSmLuaConvertSuccess = true;
LuaFunction funcRef = smlua_get_function_mod_variable(modIndex, funcStr);
if (!gSmLuaConvertSuccess) {
gSmLuaConvertSuccess = true;
funcRef = smlua_get_any_function_mod_variable(funcStr);
}
if (!gSmLuaConvertSuccess || funcRef == 0) {
LOG_LUA("Failed to call lua geo function, could not find lua function '%s'", funcStr);
return NULL;