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

Method DestroyItem

src/SB/Core/x/xFactory.cpp:171–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void xFactory::DestroyItem(xFactoryInst* item)
172{
173 S32 idx;
174 XGOFTypeInfo pattern = {};
175
176 pattern.tid = item->itemType;
177
178 if (item)
179 {
180 if (products == item)
181 {
182 products = item->nextprod;
183
184 if (products)
185 {
186 products->prevprod = NULL;
187 }
188 }
189
190 if (item->prevprod)
191 {
192 item->prevprod->nextprod = item->nextprod;
193 }
194
195 if (item->nextprod)
196 {
197 item->nextprod->prevprod = item->prevprod;
198 }
199
200 item->prevprod = NULL;
201 item->nextprod = NULL;
202
203 idx = XOrdLookup(&infolist, &pattern, OrdTest_infotype);
204
205 ((XGOFTypeInfo*)infolist.list[idx])->destroyer(item);
206 }
207}
208
209static S32 OrdTest_infotype(const void* vkey, void* vitem)
210{

Callers 1

LobotomyMethod · 0.80

Calls 1

XOrdLookupFunction · 0.70

Tested by

no test coverage detected