| 170 | } |
| 171 | |
| 172 | bool CreateCustomStat(OsiArgumentDesc & args) |
| 173 | { |
| 174 | auto statName = args[0].String; |
| 175 | auto statDescription = args[1].String; |
| 176 | auto & statId = args[2].String; |
| 177 | |
| 178 | auto statDefn = FindCustomStatDefinitionByName(statName); |
| 179 | if (statDefn != nullptr) { |
| 180 | OsiWarn("Custom stat '" << statName << "' already exists!"); |
| 181 | statId = statDefn->Id.Str; |
| 182 | return true; |
| 183 | } |
| 184 | |
| 185 | CreateCustomStatInternal(statName, statDescription); |
| 186 | |
| 187 | statDefn = FindCustomStatDefinitionByName(statName); |
| 188 | if (statDefn != nullptr) { |
| 189 | statId = statDefn->Id.Str; |
| 190 | return true; |
| 191 | } else { |
| 192 | OsiWarn("Unable to create custom stat '" << statName << "' - not found after create message ?!"); |
| 193 | return false; |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | bool GetCustomStat(OsiArgumentDesc & args) |
| 198 | { |
nothing calls this directly
no test coverage detected