| 969 | } |
| 970 | |
| 971 | static GameValue ArrayThen(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 972 | { |
| 973 | bool test = oper1; |
| 974 | const GameArrayType& array = oper2; |
| 975 | |
| 976 | if (array.Size() != 2) |
| 977 | { |
| 978 | state->SetError(EvalDim, array.Size(), 2); |
| 979 | return NOTHING; |
| 980 | } |
| 981 | if (array[0].GetType() != GameString) |
| 982 | { |
| 983 | state->TypeError(GameScalar, array[0].GetType()); |
| 984 | return NOTHING; |
| 985 | } |
| 986 | if (array[1].GetType() != GameString) |
| 987 | { |
| 988 | state->TypeError(GameScalar, array[1].GetType()); |
| 989 | return NOTHING; |
| 990 | } |
| 991 | |
| 992 | GameVarSpace local(state->GetContext()); |
| 993 | state->BeginContext(&local); |
| 994 | |
| 995 | RString expression = test ? array[0] : array[1]; |
| 996 | GameValue ret = state->EvaluateMultiple(expression); |
| 997 | state->EndContext(); |
| 998 | return ret; |
| 999 | } |
| 1000 | |
| 1001 | [[maybe_unused]] static GameValue StringEval(const GameState* state, GameValuePar oper1) |
| 1002 | { |
nothing calls this directly
no test coverage detected