File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -742,6 +742,7 @@ void LuaScriptInterface::initSimulationAPI()
742
742
{" neighbours" , simulation_neighbours},
743
743
{" neighbors" , simulation_neighbours},
744
744
{" framerender" , simulation_framerender},
745
+ {" gspeed" , simulation_gspeed},
745
746
{NULL , NULL }
746
747
};
747
748
luaL_register (l, " simulation" , simulationAPIMethods);
@@ -1981,6 +1982,20 @@ int LuaScriptInterface::simulation_framerender(lua_State * l)
1981
1982
return 0 ;
1982
1983
}
1983
1984
1985
+ int LuaScriptInterface::simulation_gspeed (lua_State * l)
1986
+ {
1987
+ if (lua_gettop (l) == 0 )
1988
+ {
1989
+ lua_pushinteger (l, luacon_sim->GSPEED );
1990
+ return 1 ;
1991
+ }
1992
+ int gspeed = luaL_checkinteger (l, 1 );
1993
+ if (gspeed < 1 )
1994
+ return luaL_error (l, " GSPEED must be at least 1" );
1995
+ luacon_sim->GSPEED = gspeed;
1996
+ return 0 ;
1997
+ }
1998
+
1984
1999
// // Begin Renderer API
1985
2000
1986
2001
void LuaScriptInterface::initRendererAPI ()
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ class LuaScriptInterface: public CommandInterface
106
106
static int simulation_photons (lua_State * l);
107
107
static int simulation_neighbours (lua_State * l);
108
108
static int simulation_framerender (lua_State * l);
109
+ static int simulation_gspeed (lua_State * l);
109
110
110
111
// Renderer
111
112
void initRendererAPI ();
Original file line number Diff line number Diff line change @@ -5050,6 +5050,8 @@ Simulation::Simulation():
5050
5050
emp_decor(0 ),
5051
5051
lightningRecreate(0 ),
5052
5052
gravWallChanged(false ),
5053
+ CGOL(0 ),
5054
+ GSPEED(1 ),
5053
5055
edgeMode(0 ),
5054
5056
gravityMode(0 ),
5055
5057
legacy_enable(0 ),
You can’t perform that action at this time.
0 commit comments