From b84bcadaeb2027467f2f676759ae7d07bf552e75 Mon Sep 17 00:00:00 2001 From: Saurtron Date: Fri, 20 Dec 2024 13:45:54 +0100 Subject: [PATCH] No need to check arguments length here since lua_isnumber will return false anyways when the argument isn't present. --- rts/Lua/LuaUnsyncedCtrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/Lua/LuaUnsyncedCtrl.cpp b/rts/Lua/LuaUnsyncedCtrl.cpp index 1e7937f349..b39c7c0534 100644 --- a/rts/Lua/LuaUnsyncedCtrl.cpp +++ b/rts/Lua/LuaUnsyncedCtrl.cpp @@ -3729,7 +3729,7 @@ int LuaUnsyncedCtrl::ShareResources(lua_State* L) return 0; } - if ((args < 3) || !lua_isnumber(L, 3)) + if (!lua_isnumber(L, 3)) luaL_error(L, "Incorrect third argument to ShareResources() for the specified resource"); if (type[0] == 'm') {