From bff0cda6631f5ed391d27773d896d40e383d8555 Mon Sep 17 00:00:00 2001
From: Agent X <44549182+AgentXLP@users.noreply.github.com>
Date: Sun, 1 Dec 2024 16:58:45 -0500
Subject: [PATCH] Disallow another dangerous function
---
autogen/convert_functions.py | 2 +-
autogen/lua_definitions/functions.lua | 4 ----
docs/lua/functions-5.md | 18 ------------------
docs/lua/functions.md | 1 -
src/pc/lua/smlua_functions_autogen.c | 16 ----------------
5 files changed, 1 insertion(+), 40 deletions(-)
diff --git a/autogen/convert_functions.py b/autogen/convert_functions.py
index dd4ed5cbf..3ff6b5a9e 100644
--- a/autogen/convert_functions.py
+++ b/autogen/convert_functions.py
@@ -91,7 +91,7 @@ override_allowed_functions = {
override_disallowed_functions = {
"src/audio/external.h": [ " func_" ],
"src/engine/math_util.h": [ "atan2f", "vec3s_sub" ],
- "src/engine/surface_load.h": [ "alloc_surface_pools" ],
+ "src/engine/surface_load.h": [ "alloc_surface_pools", "clear_dynamic_surfaces" ],
"src/engine/surface_collision.h": [ " debug_", "f32_find_wall_collision" ],
"src/game/mario_actions_airborne.c": [ "^[us]32 act_.*" ],
"src/game/mario_actions_automatic.c": [ "^[us]32 act_.*" ],
diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua
index 27c0253f5..b88dfa6b7 100644
--- a/autogen/lua_definitions/functions.lua
+++ b/autogen/lua_definitions/functions.lua
@@ -9195,10 +9195,6 @@ function find_water_level(x, z)
-- ...
end
-function clear_dynamic_surfaces()
- -- ...
-end
-
--- @param data Pointer_integer
--- @return integer
function get_area_terrain_size(data)
diff --git a/docs/lua/functions-5.md b/docs/lua/functions-5.md
index 1b02cd93b..4b2191ac6 100644
--- a/docs/lua/functions-5.md
+++ b/docs/lua/functions-5.md
@@ -5192,24 +5192,6 @@
-## [clear_dynamic_surfaces](#clear_dynamic_surfaces)
-
-### Lua Example
-`clear_dynamic_surfaces()`
-
-### Parameters
-- None
-
-### Returns
-- None
-
-### C Prototype
-`void clear_dynamic_surfaces(void);`
-
-[:arrow_up_small:](#)
-
-
-
## [get_area_terrain_size](#get_area_terrain_size)
### Lua Example
diff --git a/docs/lua/functions.md b/docs/lua/functions.md
index 2591dc0a7..7c464aa7b 100644
--- a/docs/lua/functions.md
+++ b/docs/lua/functions.md
@@ -1921,7 +1921,6 @@
- surface_load.h
- - [clear_dynamic_surfaces](functions-5.md#clear_dynamic_surfaces)
- [get_area_terrain_size](functions-5.md#get_area_terrain_size)
- [load_area_terrain](functions-5.md#load_area_terrain)
- [load_object_collision_model](functions-5.md#load_object_collision_model)
diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c
index 2b28692e3..736b5e639 100644
--- a/src/pc/lua/smlua_functions_autogen.c
+++ b/src/pc/lua/smlua_functions_autogen.c
@@ -33333,21 +33333,6 @@ int smlua_func_find_water_level(lua_State* L) {
// surface_load.h //
////////////////////
-int smlua_func_clear_dynamic_surfaces(UNUSED lua_State* L) {
- if (L == NULL) { return 0; }
-
- int top = lua_gettop(L);
- if (top != 0) {
- LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clear_dynamic_surfaces", 0, top);
- return 0;
- }
-
-
- clear_dynamic_surfaces();
-
- return 1;
-}
-
int smlua_func_get_area_terrain_size(lua_State* L) {
if (L == NULL) { return 0; }
@@ -35266,7 +35251,6 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "find_water_level", smlua_func_find_water_level);
// surface_load.h
- smlua_bind_function(L, "clear_dynamic_surfaces", smlua_func_clear_dynamic_surfaces);
smlua_bind_function(L, "get_area_terrain_size", smlua_func_get_area_terrain_size);
smlua_bind_function(L, "load_area_terrain", smlua_func_load_area_terrain);
smlua_bind_function(L, "load_object_collision_model", smlua_func_load_object_collision_model);