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

Function ItemHasDeltaModifier

OsiInterface/Functions/ItemFunctions.cpp:48–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 bool ItemHasDeltaModifier(OsiArgumentDesc & args)
49 {
50 auto itemGuid = args[0].String;
51 auto item = FindItemByNameGuid(itemGuid);
52 if (item == nullptr) {
53 OsiError("Item '" << itemGuid << "' does not exist!");
54 return false;
55 }
56
57 auto deltaMod = args[1].String;
58
59 int32_t count = 0;
60 if (item->StatsDynamic != nullptr) {
61 auto const & boosts = item->StatsDynamic->BoostNameSet;
62 for (uint32_t i = 0; i < boosts.Set.Size; i++) {
63 if (strcmp(boosts.Set.Buf[i].Str, deltaMod) == 0) {
64 count++;
65 }
66 }
67 }
68
69 if (item->Generation != nullptr) {
70 auto const & boosts = item->Generation->Boosts;
71 for (uint32_t i = 0; i < boosts.Size; i++) {
72 if (strcmp(boosts.Buf[i].Str, deltaMod) == 0) {
73 count++;
74 }
75 }
76 }
77
78 args[2].Int32 = count;
79 return count > 0;
80 }
81
82 void ItemSetIdentified(OsiArgumentDesc const & args)
83 {

Callers

nothing calls this directly

Calls 1

FindItemByNameGuidFunction · 0.85

Tested by

no test coverage detected