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

Function G_DropKey

code/game/g_combat.cpp:310–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310void G_DropKey( gentity_t *self )
311{//drop whatever security key I was holding
312 gitem_t *item = NULL;
313 if ( !Q_stricmp( "goodie", self->message ) )
314 {
315 item = FindItemForInventory( INV_GOODIE_KEY );
316 }
317 else
318 {
319 item = FindItemForInventory( INV_SECURITY_KEY );
320 }
321 gentity_t *dropped = Drop_Item( self, item, 0, qtrue );
322 //Don't throw the key
323 VectorClear( dropped->s.pos.trDelta );
324 dropped->message = self->message;
325 self->message = NULL;
326}
327
328void ObjectDie (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath )
329{

Callers 1

player_dieFunction · 0.70

Calls 4

Q_stricmpFunction · 0.85
VectorClearFunction · 0.85
FindItemForInventoryFunction · 0.70
Drop_ItemFunction · 0.70

Tested by

no test coverage detected