| 623 | } |
| 624 | |
| 625 | Object * StatFindObject(char const * name, bool warnOnError) |
| 626 | { |
| 627 | auto stats = GetStaticSymbols().GetStats(); |
| 628 | if (stats == nullptr) { |
| 629 | OsiError("RPGStats not available"); |
| 630 | return nullptr; |
| 631 | } |
| 632 | |
| 633 | auto object = stats->Objects.GetByName(FixedString(name)); |
| 634 | if (object == nullptr) { |
| 635 | if (warnOnError) { |
| 636 | OsiError("Stat object '" << name << "' does not exist"); |
| 637 | } |
| 638 | return nullptr; |
| 639 | } |
| 640 | |
| 641 | return object; |
| 642 | } |
| 643 | |
| 644 | Object * StatFindObject(int index) |
| 645 | { |
no test coverage detected