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

Function StringLocal

engine/Evaluator/express.cpp:734–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

732}
733
734static GameValue StringLocal(const GameState* state, GameValuePar oper1)
735{
736 if (oper1.GetType() == GameString)
737 {
738 RString varName = oper1;
739 if (varName[0] != '_')
740 {
741 state->SetError(EvalNamespace);
742 return NOTHING;
743 }
744 const_cast<GameState*>(state)->VarLocal(varName);
745 }
746 else
747 {
748 const GameArrayType& array = oper1;
749 for (int i = 0; i < array.Size(); i++)
750 {
751 if (array[i].GetType() != GameString)
752 {
753 state->TypeError(GameString, array[i].GetType());
754 break;
755 }
756 RString varName = array[i];
757 if (varName[0] != '_')
758 {
759 state->SetError(EvalNamespace);
760 return NOTHING;
761 }
762 const_cast<GameState*>(state)->VarLocal(varName);
763 }
764 }
765 return NOTHING;
766}
767
768static GameValue StringCallNoArg(const GameState* state, GameValuePar oper1)
769{

Callers

nothing calls this directly

Calls 5

VarLocalMethod · 0.80
TypeErrorMethod · 0.80
GetTypeMethod · 0.45
SetErrorMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected