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

Function CharacterSetCustomStat

OsiInterface/Functions/CustomStatFunctions.cpp:136–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134 }
135
136 void CharacterSetCustomStat(OsiArgumentDesc const & args)
137 {
138 auto character = FindCharacterByNameGuid(args[0].String);
139 auto statId = args[1].String;
140 auto statValue = args[2].Int32;
141
142 auto statDefn = FindCustomStatDefinitionById(statId);
143 if (statDefn == nullptr) return;
144
145 auto entityWorld = GetEntityWorld();
146 auto statsComponent = entityWorld->GetCustomStatsComponentByEntityHandle(character->Base.EntityObjectHandle);
147
148 CharacterSyncCustomStats(character, statsComponent, statDefn->Id, statValue);
149 }
150
151 void CreateCustomStatInternal(char const * name, char const * description)
152 {

Callers

nothing calls this directly

Calls 5

FindCharacterByNameGuidFunction · 0.85
GetEntityWorldFunction · 0.85
CharacterSyncCustomStatsFunction · 0.85

Tested by

no test coverage detected