The const variant only sets local variables: name must start with '_' or forceLocal must be set, otherwise it errors.
| 2580 | // The const variant only sets local variables: name must start with '_' or |
| 2581 | // forceLocal must be set, otherwise it errors. |
| 2582 | void 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 | |
| 2606 | void GameState::VarDelete(const char* name) |
| 2607 | { |
no test coverage detected