| 169 | } |
| 170 | |
| 171 | void 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 | |
| 209 | static S32 OrdTest_infotype(const void* vkey, void* vitem) |
| 210 | { |