File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed
Server/mods/deathmatch/logic Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,9 @@ class CGame
406
406
void ApplyAseSetting ( void );
407
407
bool IsUsingMtaServerConf ( void ) { return m_bUsingMtaServerConf; }
408
408
409
+ inline void SetDevelopmentMode (bool enabled) { m_DevelopmentModeEnabled = enabled; }
410
+ inline bool GetDevelopmentMode () { return m_DevelopmentModeEnabled; }
411
+
409
412
private:
410
413
void AddBuiltInEvents ( void );
411
414
void RelayPlayerPuresync ( class CPacket & Packet );
@@ -593,6 +596,8 @@ class CGame
593
596
SString m_strPrevLowestConnectedPlayerVersion;
594
597
595
598
SharedUtil::CAsyncTaskScheduler* m_pAsyncTaskScheduler;
599
+
600
+ bool m_DevelopmentModeEnabled;
596
601
};
597
602
598
603
#endif
Original file line number Diff line number Diff line change @@ -1240,3 +1240,31 @@ int CLuaFunctionDefs::GetPerformanceStats ( lua_State* luaVM )
1240
1240
lua_pushboolean ( luaVM, false );
1241
1241
return 1 ;
1242
1242
}
1243
+
1244
+ int CLuaFunctionDefs::SetDevelopmentMode (lua_State* luaVM)
1245
+ {
1246
+ // bool setDevelopmentMode ( bool enable )
1247
+ bool enable;
1248
+
1249
+ CScriptArgReader argStream (luaVM);
1250
+ argStream.ReadBool (enable);
1251
+
1252
+ if (!argStream.HasErrors ())
1253
+ {
1254
+ g_pGame->SetDevelopmentMode (enable);
1255
+ lua_pushboolean (luaVM, true );
1256
+ return 1 ;
1257
+ }
1258
+ else
1259
+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
1260
+
1261
+ lua_pushboolean (luaVM, false );
1262
+ return 1 ;
1263
+ }
1264
+
1265
+ int CLuaFunctionDefs::GetDevelopmentMode (lua_State* luaVM)
1266
+ {
1267
+ // bool getDevelopmentMode ()
1268
+ lua_pushboolean (luaVM, g_pGame->GetDevelopmentMode ());
1269
+ return 1 ;
1270
+ }
Original file line number Diff line number Diff line change @@ -164,6 +164,9 @@ class CLuaFunctionDefs
164
164
LUA_DECLARE ( GetModules );
165
165
LUA_DECLARE ( GetModuleInfo );
166
166
167
+ LUA_DECLARE (SetDevelopmentMode);
168
+ LUA_DECLARE (GetDevelopmentMode);
169
+
167
170
private:
168
171
// Static references to objects
169
172
static CBlipManager* m_pBlipManager;
Original file line number Diff line number Diff line change @@ -328,7 +328,10 @@ void CLuaManager::LoadCFunctions ( void )
328
328
CLuaCFunctions::AddFunction ( " getNetworkUsageData" , CLuaFunctionDefs::GetNetworkUsageData );
329
329
CLuaCFunctions::AddFunction ( " getNetworkStats" , CLuaFunctionDefs::GetNetworkStats );
330
330
CLuaCFunctions::AddFunction ( " getLoadedModules" , CLuaFunctionDefs::GetModules );
331
- CLuaCFunctions::AddFunction ( " getModuleInfo" , CLuaFunctionDefs::GetModuleInfo );
331
+ CLuaCFunctions::AddFunction ( " getModuleInfo" , CLuaFunctionDefs::GetModuleInfo );
332
+
333
+ CLuaCFunctions::AddFunction (" setDevelopmentMode" , CLuaFunctionDefs::SetDevelopmentMode);
334
+ CLuaCFunctions::AddFunction (" getDevelopmentMode" , CLuaFunctionDefs::GetDevelopmentMode);
332
335
333
336
// Backward compat functions at the end, so the new function name is used in ACL
334
337
You can’t perform that action at this time.
0 commit comments