| 624 | } |
| 625 | |
| 626 | static GameValue ListSelect(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 627 | { |
| 628 | const GameArrayType& array = oper1; |
| 629 | float index = oper2; |
| 630 | int sel = toInt(index); |
| 631 | if (sel < 0 || sel >= array.Size()) |
| 632 | { |
| 633 | if (sel != array.Size()) |
| 634 | { |
| 635 | state->SetError(EvalDivZero); |
| 636 | } |
| 637 | return GameValue(); |
| 638 | } |
| 639 | return array[sel]; |
| 640 | } |
| 641 | |
| 642 | static GameValue ListResize(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 643 | { |