MCPcopy Create free account
hub / github.com/JACoders/OpenJK / FindItemForInventory

Function FindItemForInventory

code/game/bg_misc.cpp:267–288  ·  view source on GitHub ↗

----------------------------------------------

Source from the content-addressed store, hash-verified

265
266//----------------------------------------------
267gitem_t *FindItemForInventory( int inv )
268{
269 int i;
270 gitem_t *it;
271
272 // Now just check for any other kind of item.
273 for ( i = 1 ; i < bg_numItems ; i++ )
274 {
275 it = &bg_itemlist[i];
276
277 if ( it->giType == IT_HOLDABLE )
278 {
279 if ( it->giTag == inv )
280 {
281 return it;
282 }
283 }
284 }
285
286 Com_Error( ERR_DROP, "Couldn't find item for inventory %i", inv );
287 return NULL;
288}
289
290/*
291===============

Callers 6

G_DropKeyFunction · 0.70
Q3_SetItemFunction · 0.70
NPC_TouchFunction · 0.70
ClearRegisteredItemsFunction · 0.70
SP_NPC_spawnerFunction · 0.70

Calls 1

Com_ErrorFunction · 0.70

Tested by

no test coverage detected