MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / XOrdRemove

Function XOrdRemove

src/SB/Core/x/xordarray.cpp:78–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void* XOrdRemove(st_XORDEREDARRAY* array, void* elt, S32 index)
79{
80 if (elt == NULL)
81 {
82 if (index < 0)
83 {
84 return NULL;
85 }
86 if (index >= array->max)
87 {
88 return NULL;
89 }
90 }
91
92 if ((index >= 0) && (index < array->max))
93 {
94 elt = array->list[index];
95 }
96 else if (elt != NULL)
97 {
98 index = -1;
99 int iVar4 = 0;
100 for (int i = array->cnt; i > 0; i--)
101 {
102 if (array->list[iVar4] == elt)
103 {
104 index = iVar4;
105 break;
106 }
107 iVar4++;
108 }
109 }
110
111 if (index < 0)
112 {
113 return NULL;
114 }
115
116 array->cnt--;
117 for (; index < array->cnt; index++)
118 {
119 array->list[index] = array->list[index + 1];
120 }
121
122 return elt;
123}
124
125S32 XOrdLookup(st_XORDEREDARRAY* array, const void* key, XOrdTestCallback test)
126{

Callers 4

UnSubscribeMethod · 0.70
SpawnBeastieMethod · 0.50
ToastedBeastieMethod · 0.50
zNPCMsg_TimestepFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected