MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / ScriptAssert

Function ScriptAssert

TombEngine/Scripting/Internal/ScriptAssert.cpp:17–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17bool ScriptAssert(bool cond, const std::string& msg, std::optional<ErrorMode> forceMode)
18{
19 if (!cond)
20 {
21 auto mode = forceMode ? *forceMode : ScriptErrorMode;
22 switch (mode)
23 {
24 case ErrorMode::Warn:
25 TENLog(msg, LogLevel::Error, LogConfig::All);
26 break;
27
28 case ErrorMode::Terminate:
29 TENLog(msg, LogLevel::Error, LogConfig::All);
30 throw TENScriptException(msg);
31 break;
32 }
33 }
34
35 return cond;
36}
37
38void SetScriptErrorMode(ErrorMode mode)
39{

Callers 15

SetVariableFunction · 0.85
SetLevelFuncsMemberMethod · 0.85
GetVariablesMethod · 0.85
GetByNameFunction · 0.85
GetStringMethod · 0.85
SetActionMethod · 0.85
SetWeatherStrengthMethod · 0.85
SetNameMethod · 0.85
SetNameMethod · 0.85
SetNameMethod · 0.85
SetNameMethod · 0.85
CreateFunction · 0.85

Calls 2

TENLogFunction · 0.85
TENScriptExceptionClass · 0.85

Tested by

no test coverage detected