MCPcopy Create free account
hub / github.com/Norbyte/ositools / GetCharacterDynamicStat

Function GetCharacterDynamicStat

OsiInterface/Functions/CharacterFunctions.cpp:12–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 4

CharacterDisableTalentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected