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

Function StatusGetHandle

OsiInterface/Functions/StatusFunctions.cpp:81–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 }
80
81 bool StatusGetHandle(OsiArgumentDesc & args)
82 {
83 auto gameObjectGuid = args[0].String;
84 auto statusId = args[1].String;
85
86 auto statusMachine = GetStatusMachine(gameObjectGuid);
87 if (statusMachine == nullptr) return false;
88
89 auto statusIdFS = ToFixedString(args[1].String);
90 if (!statusIdFS) {
91 // No fixed string with this ID --> invalid status name
92 OsiWarn("Status " << args[1].String << " not in string table, possibly invalid status name?");
93 return false;
94 }
95
96 auto & statuses = statusMachine->Statuses.Set;
97 for (uint32_t index = 0; index < statuses.Size; index++) {
98 auto status = statuses.Buf[index];
99 if (status->StatusId == statusIdFS) {
100 args[2].Int64 = (int64_t)status->StatusHandle;
101 return true;
102 }
103 }
104
105 return false;
106 }
107
108 template <OsiPropertyMapType Type>
109 bool StatusGetAttribute(OsiArgumentDesc & args)

Callers

nothing calls this directly

Calls 2

GetStatusMachineFunction · 0.85
ToFixedStringFunction · 0.85

Tested by

no test coverage detected