| 10 | namespace func |
| 11 | { |
| 12 | CharacterDynamicStat * GetCharacterDynamicStat(esv::Character * character, uint32_t index) |
| 13 | { |
| 14 | if (character->Stats == nullptr) { |
| 15 | OsiError("Character has no stats!"); |
| 16 | return nullptr; |
| 17 | } |
| 18 | |
| 19 | if (character->Stats->DynamicStats == nullptr) { |
| 20 | OsiError("Character has no dynamic stats!"); |
| 21 | return nullptr; |
| 22 | } |
| 23 | |
| 24 | auto numStats = character->Stats->DynamicStatsEnd - character->Stats->DynamicStats; |
| 25 | if (numStats <= index) { |
| 26 | OsiError("Tried to get dynamic stat " << index << ", character only has " << numStats); |
| 27 | return nullptr; |
| 28 | } |
| 29 | |
| 30 | return character->Stats->DynamicStats[index]; |
| 31 | } |
| 32 | |
| 33 | bool CharacterGetComputedStat(OsiArgumentDesc & args) |
| 34 | { |
no outgoing calls
no test coverage detected