MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / CmdExec

Function CmdExec

engine/Evaluator/EvalState.cpp:720–732  ·  view source on GitHub ↗

In-game exec is non-blocking; the evaluator runs the SQS synchronously.

Source from the content-addressed store, hash-verified

718
719// In-game exec is non-blocking; the evaluator runs the SQS synchronously.
720static GameValue CmdExec(const GameState* state, GameValuePar lhs, GameValuePar rhs)
721{
722 RString filename = rhs;
723 std::string content = readFileContent((const char*)filename);
724 if (content.empty())
725 return NOTHING;
726
727 auto* eval = getEval(state);
728 SqsRunner runner((const char*)filename);
729 runner.parse(content);
730 runner.run(*eval, lhs);
731 return NOTHING;
732}
733
734static GameValue CmdCall(const GameState* state, GameValuePar lhs, GameValuePar rhs)
735{

Callers

nothing calls this directly

Calls 5

readFileContentFunction · 0.85
getEvalFunction · 0.85
runMethod · 0.80
emptyMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected