static gsitem_t *G_ItemForEntity( edict_t *ent ) { gsitem_t *item; // check item spawn functions if( ( item = GS_FindItemByClassname( ent->classname ) ) != NULL ) return item; return NULL; }
static void Say_Team_Pickup( edict_t *who, char *buf, int buflen, const char *current_color ) { if( !who->r.client->teamstate.last_pickup ) { buf[0] = 0; } else { gsitem_t *item = GS_FindItemByClassname( who->r.client->teamstate.last_pickup->classname ); if( item ) Q_snprintfz( buf, buflen, "%s%s%s", ( item->color ? item->color : "" ), item->shortname, current_color ); else buf[0] = 0; } }
static void Say_Team_Point( edict_t *who, char *buf, int buflen, const char *current_color ) { if( !point ) { Q_snprintfz( buf, buflen, "nothing" ); return; } if( point->s.type == ET_ITEM ) { gsitem_t *item = GS_FindItemByClassname( point->classname ); if( item ) Q_snprintfz( buf, buflen, "%s%s%s", ( item->color ? item->color : "" ), item->shortname, current_color ); else Q_snprintfz( buf, buflen, point->classname ); } else { Q_snprintfz( buf, buflen, "%s%s", point->classname, current_color ); } }
/* * SetItemNames * * Called by worldspawn */ void G_PrecacheItems( void ) { int i; gsitem_t *item; // precache item names and weapondefs for( i = 1; ( item = GS_FindItemByTag( i ) ) != NULL; i++ ) { trap_ConfigString( CS_ITEMS + i, item->name ); if( item->type & IT_WEAPON && GS_GetWeaponDef( item->tag ) ) { G_PrecacheWeapondef( i, &GS_GetWeaponDef( item->tag )->firedef ); G_PrecacheWeapondef( i, &GS_GetWeaponDef( item->tag )->firedef_weak ); } } // precache items if( GS_Instagib() ) { item = GS_FindItemByTag( WEAP_INSTAGUN ); PrecacheItem( item ); } else { for( i = WEAP_GUNBLADE; i < WEAP_TOTAL; i++ ) { item = GS_FindItemByTag( i ); PrecacheItem( item ); } } // Vic: precache ammo pack if it's droppable item = GS_FindItemByClassname( "item_ammopack" ); if( item && G_Gametype_CanDropItem( item, qtrue ) ) { PrecacheItem( item ); } }