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

Method VarSetLocal

engine/Evaluator/express.cpp:2582–2604  ·  view source on GitHub ↗

The const variant only sets local variables: name must start with '_' or forceLocal must be set, otherwise it errors.

Source from the content-addressed store, hash-verified

2580// The const variant only sets local variables: name must start with '_' or
2581// forceLocal must be set, otherwise it errors.
2582void GameState::VarSetLocal(const char* name, GameValuePar value, bool readOnly, bool forceLocal) const
2583{
2584 // convert name to lower case
2585 RString source = name;
2586 source.Lower();
2587
2588 if (forceLocal || *name == '_')
2589 {
2590 }
2591 else
2592 {
2593 SetError(EvalBadVar);
2594 return;
2595 }
2596 GameVarSpace* space = _e->local;
2597 if (!space)
2598 {
2599 SetError(EvalNamespace);
2600 return;
2601 }
2602 space->VarLocal(source);
2603 space->VarSet(source, value, readOnly);
2604}
2605
2606void GameState::VarDelete(const char* name)
2607{

Callers 12

StringCallFunction · 0.80
ForDoOpFunction · 0.80
ListCountCondFunction · 0.80
ListForEachFunction · 0.80
runMethod · 0.80
CmdCallFunction · 0.80
EvaluateSqfFileMethod · 0.80
OnEventMethod · 0.80
ExecuteNamedRemoteExecFunction · 0.80
ExecuteNamedRemoteExecFunction · 0.80
OnLButtonClickMethod · 0.80
SimulateBodyMethod · 0.80

Calls 4

LowerMethod · 0.80
VarLocalMethod · 0.80
SetErrorFunction · 0.50
VarSetMethod · 0.45

Tested by

no test coverage detected