diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_buildable.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_draw.c | 17 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 149 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 53 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 7 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 55 | ||||
-rw-r--r-- | src/cgame/cg_playerstate.c | 10 | ||||
-rw-r--r-- | src/cgame/cg_predict.c | 14 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 469 |
9 files changed, 219 insertions, 557 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index b61735a7..03123e3c 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -390,8 +390,6 @@ void CG_Buildable( centity_t *cent ) trace_t tr; es = ¢->currentState; - if ( es->modelindex >= bg_numItems ) - CG_Error( "Bad item index %i on entity", es->modelindex ); //add creep if( es->modelindex2 == BIT_ALIENS ) diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 5acb96d8..e0c8d768 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -216,9 +216,9 @@ void CG_DrawFlagModel( float x, float y, float w, float h, int team, qboolean fo team == TEAM_HUMANS ? cgs.media.redFlagModel : cgs.media.blueFlagModel, 0, origin, angles ); } else if ( cg_drawIcons.integer ) { - gitem_t *item = BG_FindItemForPowerup( team == TEAM_HUMANS ? PW_REDFLAG : PW_BLUEFLAG ); +/* gitem_t *item = BG_FindItemForPowerup( team == TEAM_HUMANS ? PW_REDFLAG : PW_BLUEFLAG ); - CG_DrawPic( x, y, w, h, cg_items[ ITEM_INDEX(item) ].icon ); + CG_DrawPic( x, y, w, h, cg_items[ ITEM_INDEX(item) ].icon );*/ } } @@ -451,7 +451,7 @@ static void CG_DrawStatusBar( void ) { // if ( cent->currentState.weapon ) { //TA: must mask off clips and maxClips - if( !BG_infiniteAmmo( cent->currentState.weapon ) ) + if( !BG_FindInfinteAmmoForWeapon( cent->currentState.weapon ) ) BG_unpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &ammo, &clips, &maxclips ); else ammo = -1; @@ -1088,7 +1088,7 @@ static float CG_DrawScores( float y ) { if ( cgs.gametype == GT_CTF ) { // Display flag status - item = BG_FindItemForPowerup( PW_BLUEFLAG ); + /*item = BG_FindItemForPowerup( PW_BLUEFLAG );*/ if (item) { y1 = y - BIGCHAR_HEIGHT - 8; @@ -1113,7 +1113,7 @@ static float CG_DrawScores( float y ) { if ( cgs.gametype == GT_CTF ) { // Display flag status - item = BG_FindItemForPowerup( PW_REDFLAG ); + /*item = BG_FindItemForPowerup( PW_REDFLAG );*/ if (item) { y1 = y - BIGCHAR_HEIGHT - 8; @@ -1263,7 +1263,7 @@ static float CG_DrawPowerups( float y ) { // draw the icons and timers x = 640 - ICON_SIZE - CHAR_WIDTH * 2; for ( i = 0 ; i < active ; i++ ) { - item = BG_FindItemForPowerup( sorted[i] ); + /*item = BG_FindItemForPowerup( sorted[i] );*/ if (item) { @@ -1343,10 +1343,11 @@ static int CG_DrawPickupItem( int y ) { if ( value ) { fadeColor = CG_FadeColor( cg.itemPickupTime, 3000 ); if ( fadeColor ) { - CG_RegisterItemVisuals( value ); + /*CG_RegisterItemVisuals( value );*/ trap_R_SetColor( fadeColor ); CG_DrawPic( 8, y, ICON_SIZE, ICON_SIZE, cg_items[ value ].icon ); - CG_DrawBigString( ICON_SIZE + 16, y + (ICON_SIZE/2 - BIGCHAR_HEIGHT/2), bg_itemlist[ value ].pickup_name, fadeColor[0] ); + //TA: BG_FindHumanNameForWeapon is probably highly inappropriate here, but this will probably never get called + CG_DrawBigString( ICON_SIZE + 16, y + (ICON_SIZE/2 - BIGCHAR_HEIGHT/2), BG_FindHumanNameForWeapon( value ), fadeColor[0] ); trap_R_SetColor( NULL ); } } diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index a2f5a2b0..a7e95e1c 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -212,152 +212,6 @@ static void CG_Speaker( centity_t *cent ) { cent->miscTime = cg.time + cent->currentState.frame * 100 + cent->currentState.clientNum * 100 * crandom(); } -/* -================== -CG_Item -================== -*/ -static void CG_Item( centity_t *cent ) { - refEntity_t ent; - entityState_t *es; - gitem_t *item; - int msec; - float frac; - float scale; - weaponInfo_t *wi; - - - es = ¢->currentState; - if ( es->modelindex >= bg_numItems ) { - CG_Error( "Bad item index %i on entity", es->modelindex ); - } - - // if set to invisible, skip - if ( !es->modelindex || ( es->eFlags & EF_NODRAW ) ) { - return; - } - - item = &bg_itemlist[ es->modelindex ]; - if ( cg_simpleItems.integer && item->giType != IT_TEAM ) { - memset( &ent, 0, sizeof( ent ) ); - ent.reType = RT_SPRITE; - VectorCopy( cent->lerpOrigin, ent.origin ); - ent.radius = 14; - ent.customShader = cg_items[es->modelindex].icon; - ent.shaderRGBA[0] = 255; - ent.shaderRGBA[1] = 255; - ent.shaderRGBA[2] = 255; - ent.shaderRGBA[3] = 255; - trap_R_AddRefEntityToScene(&ent); - return; - } - - // items bob up and down continuously - scale = 0.005 + cent->currentState.number * 0.00001; - cent->lerpOrigin[2] += 4 + cos( ( cg.time + 1000 ) * scale ) * 4; - - memset (&ent, 0, sizeof(ent)); - - // autorotate at one of two speeds - if ( item->giType == IT_HEALTH ) { - VectorCopy( cg.autoAnglesFast, cent->lerpAngles ); - AxisCopy( cg.autoAxisFast, ent.axis ); - } else { - VectorCopy( cg.autoAngles, cent->lerpAngles ); - AxisCopy( cg.autoAxis, ent.axis ); - } - - // the weapons have their origin where they attatch to player - // models, so we need to offset them or they will rotate - // eccentricly - wi = NULL; - if ( item->giType == IT_WEAPON ) { - - wi = &cg_weapons[item->giTag]; - cent->lerpOrigin[0] -= - wi->weaponMidpoint[0] * ent.axis[0][0] + - wi->weaponMidpoint[1] * ent.axis[1][0] + - wi->weaponMidpoint[2] * ent.axis[2][0]; - cent->lerpOrigin[1] -= - wi->weaponMidpoint[0] * ent.axis[0][1] + - wi->weaponMidpoint[1] * ent.axis[1][1] + - wi->weaponMidpoint[2] * ent.axis[2][1]; - cent->lerpOrigin[2] -= - wi->weaponMidpoint[0] * ent.axis[0][2] + - wi->weaponMidpoint[1] * ent.axis[1][2] + - wi->weaponMidpoint[2] * ent.axis[2][2]; - - cent->lerpOrigin[2] += 8; // an extra height boost - } - - ent.hModel = cg_items[es->modelindex].models[0]; - - VectorCopy( cent->lerpOrigin, ent.origin); - VectorCopy( cent->lerpOrigin, ent.oldorigin); - - ent.nonNormalizedAxes = qfalse; - - // if just respawned, slowly scale up - msec = cg.time - cent->miscTime; - if ( msec >= 0 && msec < ITEM_SCALEUP_TIME ) { - frac = (float)msec / ITEM_SCALEUP_TIME; - VectorScale( ent.axis[0], frac, ent.axis[0] ); - VectorScale( ent.axis[1], frac, ent.axis[1] ); - VectorScale( ent.axis[2], frac, ent.axis[2] ); - ent.nonNormalizedAxes = qtrue; - } else { - frac = 1.0; - } - - // items without glow textures need to keep a minimum light value - // so they are always visible - if ( ( item->giType == IT_WEAPON ) || - ( item->giType == IT_ARMOR ) ) { - ent.renderfx |= RF_MINLIGHT; - } - - // increase the size of the weapons when they are presented as items - if ( item->giType == IT_WEAPON ) { - VectorScale( ent.axis[0], 1.5, ent.axis[0] ); - VectorScale( ent.axis[1], 1.5, ent.axis[1] ); - VectorScale( ent.axis[2], 1.5, ent.axis[2] ); - ent.nonNormalizedAxes = qtrue; - } - - // add to refresh list - trap_R_AddRefEntityToScene(&ent); - - // accompanying rings / spheres for powerups - if ( !cg_simpleItems.integer ) - { - vec3_t spinAngles; - - VectorClear( spinAngles ); - - if ( item->giType == IT_HEALTH || item->giType == IT_POWERUP ) - { - if ( ( ent.hModel = cg_items[es->modelindex].models[1] ) != 0 ) - { - if ( item->giType == IT_POWERUP ) - { - ent.origin[2] += 12; - spinAngles[1] = ( cg.time & 1023 ) * 360 / -1024.0f; - } - AnglesToAxis( spinAngles, ent.axis ); - - // scale up if respawning - if ( frac != 1.0 ) { - VectorScale( ent.axis[0], frac, ent.axis[0] ); - VectorScale( ent.axis[1], frac, ent.axis[1] ); - VectorScale( ent.axis[2], frac, ent.axis[2] ); - ent.nonNormalizedAxes = qtrue; - } - trap_R_AddRefEntityToScene( &ent ); - } - } - } -} - //============================================================================ @@ -968,9 +822,6 @@ static void CG_AddCEntity( centity_t *cent ) { case ET_PLAYER: CG_Player( cent ); break; - case ET_ITEM: - CG_Item( cent ); - break; case ET_BUILDABLE: CG_Buildable( cent ); break; diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index ec521b80..d5766621 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -321,7 +321,7 @@ static void CG_UseItem( centity_t *cent ) { if ( !itemNum ) { CG_CenterPrint( "No item to use", SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH ); } else { - item = BG_FindItemForHoldable( itemNum ); + /*item = BG_FindItemForHoldable( itemNum );*/ CG_CenterPrint( va("Use %s", item->pickup_name), SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH ); } } @@ -359,13 +359,6 @@ static void CG_ItemPickup( int itemNum ) { cg.itemPickupTime = cg.time; cg.itemPickupBlendTime = cg.time; // see if it should be the grabbed weapon - if ( bg_itemlist[itemNum].giType == IT_WEAPON ) { - // select it immediately - if ( cg_autoswitch.integer && bg_itemlist[itemNum].giTag != WP_MACHINEGUN ) { - cg.weaponSelectTime = cg.time; - cg.weaponSelect = bg_itemlist[itemNum].giTag; - } - } } @@ -667,52 +660,12 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_ITEM_PICKUP: DEBUGNAME("EV_ITEM_PICKUP"); { - gitem_t *item; - int index; - - index = es->eventParm; // player predicted - - if ( index < 1 || index >= bg_numItems ) { - break; - } - item = &bg_itemlist[ index ]; - - // powerups and team items will have a separate global sound, this one - // will be played at prediction time - if ( item->giType == IT_POWERUP || item->giType == IT_TEAM) { - trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.n_healthSound ); - } else { - trap_S_StartSound (NULL, es->number, CHAN_AUTO, trap_S_RegisterSound( item->pickup_sound, qfalse ) ); - } - - // show icon and name on status bar - if ( es->number == cg.snap->ps.clientNum ) { - CG_ItemPickup( index ); - } } break; case EV_GLOBAL_ITEM_PICKUP: DEBUGNAME("EV_GLOBAL_ITEM_PICKUP"); { - gitem_t *item; - int index; - - index = es->eventParm; // player predicted - - if ( index < 1 || index >= bg_numItems ) { - break; - } - item = &bg_itemlist[ index ]; - // powerup pickups are global - if( item->pickup_sound ) { - trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( item->pickup_sound, qfalse ) ); - } - - // show icon and name on status bar - if ( es->number == cg.snap->ps.clientNum ) { - CG_ItemPickup( index ); - } } break; @@ -889,14 +842,14 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) break; case EV_RAILTRAIL: - DEBUGNAME("EV_RAILTRAIL"); +/* DEBUGNAME("EV_RAILTRAIL"); cent->currentState.weapon = WP_RAILGUN; // if the end was on a nomark surface, don't make an explosion CG_RailTrail( es->origin2, es->pos.trBase ); if ( es->eventParm != 255 ) { ByteToDir( es->eventParm, dir ); CG_MissileHitWall( es->weapon, es->clientNum, position, dir, IMPACTSOUND_DEFAULT ); - } + }*/ break; case EV_TESLATRAIL: diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 5b972aa8..514cc3c5 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -374,6 +374,7 @@ typedef struct { typedef struct weaponInfo_s { qboolean registered; gitem_t *item; + char *humanName; qhandle_t handsModel; // the hands don't actually draw, they just position the weapon qhandle_t weaponModel; @@ -410,7 +411,7 @@ typedef struct weaponInfo_s { typedef struct upgradeInfo_s { qboolean registered; - gitem_t *item; + char *humanName; qhandle_t upgradeIcon; } upgradeInfo_t; @@ -1411,8 +1412,10 @@ void CG_NextWeapon_f( void ); void CG_PrevWeapon_f( void ); void CG_Weapon_f( void ); +void CG_InitUpgrades( ); +void CG_RegisterUpgrade( int upgradeNum ); +void CG_InitWeapons( ); void CG_RegisterWeapon( int weaponNum ); -void CG_RegisterItemVisuals( int itemNum ); void CG_FireWeapon( centity_t *cent ); void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, impactSound_t soundType ); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index c26564da..0052b426 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -474,44 +474,6 @@ The server says this item is used on this level ================= */ static void CG_RegisterItemSounds( int itemNum ) { - gitem_t *item; - char data[MAX_QPATH]; - char *s, *start; - int len; - - item = &bg_itemlist[ itemNum ]; - - if( item->pickup_sound ) { - trap_S_RegisterSound( item->pickup_sound, qfalse ); - } - - // parse the space seperated precache string for other media - s = item->sounds; - if (!s || !s[0]) - return; - - while (*s) { - start = s; - while (*s && *s != ' ') { - s++; - } - - len = s-start; - if (len >= MAX_QPATH || len < 5) { - CG_Error( "PrecacheItem: %s has bad precache string", - item->classname); - return; - } - memcpy (data, start, len); - data[len] = 0; - if ( *s ) { - s++; - } - - if ( !strcmp(data+len-3, "wav" )) { - trap_S_RegisterSound( data, qfalse ); - } - } } @@ -638,12 +600,6 @@ static void CG_RegisterSounds( void ) { // only register the items that the server says we need strcpy( items, CG_ConfigString( CS_ITEMS ) ); - for ( i = 1 ; i < bg_numItems ; i++ ) { - //if ( items[ i ] == '1' || cg_buildScript.integer ) { - CG_RegisterItemSounds( i ); - //} - } - for ( i = 1 ; i < MAX_SOUNDS ; i++ ) { soundName = CG_ConfigString( CS_SOUNDS+i ); if ( !soundName[0] ) { @@ -873,15 +829,6 @@ static void CG_RegisterGraphics( void ) { // only register the items that the server says we need strcpy( items, CG_ConfigString( CS_ITEMS) ); - for( i = 1; i < bg_numItems; i++ ) - { - if( items[ i ] == '1' || cg_buildScript.integer ) - { - CG_LoadingItem( i ); - CG_RegisterItemVisuals( i ); - } - } - // wall marks cgs.media.bulletMarkShader = trap_R_RegisterShader( "gfx/damage/bullet_mrk" ); cgs.media.burnMarkShader = trap_R_RegisterShader( "gfx/damage/burn_med_mrk" ); @@ -1107,6 +1054,8 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) { //TA: CG_InitBuildables( ); + CG_InitWeapons( ); + CG_InitUpgrades( ); CG_LoadingString( "clients" ); diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c index 7573b471..e8a94a2e 100644 --- a/src/cgame/cg_playerstate.c +++ b/src/cgame/cg_playerstate.c @@ -43,11 +43,11 @@ void CG_CheckAmmo( void ) { BG_unpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips, &maxclips ); switch ( i ) { - case WP_ROCKET_LAUNCHER: + /*case WP_ROCKET_LAUNCHER:*/ case WP_LOCKBLOB_LAUNCHER: - case WP_GRENADE_LAUNCHER: - case WP_RAILGUN: - case WP_SHOTGUN: + /*case WP_GRENADE_LAUNCHER:*/ + /*case WP_RAILGUN:*/ + /*case WP_SHOTGUN:*/ total += ammo * 1000; break; default: @@ -56,7 +56,7 @@ void CG_CheckAmmo( void ) { total += ammo * 200; break; } - if ( total >= 5000 || BG_infiniteAmmo( i ) ) + if ( total >= 5000 || BG_FindInfinteAmmoForWeapon( i ) ) { cg.lowAmmoWarning = 0; return; diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c index 3a2ae803..08e22518 100644 --- a/src/cgame/cg_predict.c +++ b/src/cgame/cg_predict.c @@ -285,20 +285,18 @@ static void CG_TouchItem( centity_t *cent ) { if ( !cg_predictItems.integer ) { return; } - if ( !BG_PlayerTouchesItem( &cg.predictedPlayerState, ¢->currentState, cg.time ) ) { +/* if ( !BG_PlayerTouchesItem( &cg.predictedPlayerState, ¢->currentState, cg.time ) ) { return; - } + }*/ // never pick an item up twice in a prediction if ( cent->miscTime == cg.time ) { return; } - if ( !BG_CanItemBeGrabbed( cgs.gametype, ¢->currentState, &cg.predictedPlayerState ) ) { +/* if ( !BG_CanItemBeGrabbed( cgs.gametype, ¢->currentState, &cg.predictedPlayerState ) ) { return; // can't hold it - } - - item = &bg_itemlist[ cent->currentState.modelindex ]; + }*/ // grab it BG_AddPredictableEventToPlayerstate( EV_ITEM_PICKUP, cent->currentState.modelindex , &cg.predictedPlayerState); @@ -310,12 +308,12 @@ static void CG_TouchItem( centity_t *cent ) { cent->miscTime = cg.time; // if its a weapon, give them some predicted ammo so the autoswitch will work - if ( item->giType == IT_WEAPON ) { +/* if ( item->giType == IT_WEAPON ) { BG_packWeapon( item->giTag, cg.predictedPlayerState.stats ); if ( ammo == 0 && clips == 0 ) { BG_packAmmoArray( item->giTag, cg.predictedPlayerState.ammo, cg.predictedPlayerState.powerups, 1, 0, 0 ); } - } + }*/ } diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 8b832966..c14aba28 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -536,37 +536,48 @@ CG_RegisterUpgrade The server says this item is used on this level ================= */ -void CG_RegisterUpgrade( int upgradeNum ) { - upgradeInfo_t *upgradeInfo; - gitem_t *item; - char path[MAX_QPATH]; - int i; +void CG_RegisterUpgrade( int upgradeNum ) +{ + upgradeInfo_t *upgradeInfo; + char path[MAX_QPATH]; + int i; + char *icon; upgradeInfo = &cg_upgrades[ upgradeNum ]; - if ( upgradeNum == 0 ) { + if( upgradeNum == 0 ) return; - } - if ( upgradeInfo->registered ) { + if( upgradeInfo->registered ) return; - } memset( upgradeInfo, 0, sizeof( *upgradeInfo ) ); upgradeInfo->registered = qtrue; - for ( item = bg_itemlist + 1 ; item->classname ; item++ ) { - if ( item->giType == IT_UPGRADE && item->giTag == upgradeNum ) { - upgradeInfo->item = item; - break; - } - } - if ( !item->classname ) { + if( !BG_FindNameForUpgrade( upgradeNum ) ) CG_Error( "Couldn't find upgrade %i", upgradeNum ); - } - CG_RegisterItemVisuals( item - bg_itemlist ); + + upgradeInfo->humanName = BG_FindHumanNameForUpgrade( upgradeNum ); + + if( icon = BG_FindIconForUpgrade( upgradeNum ) ) + upgradeInfo->upgradeIcon = trap_R_RegisterShader( icon ); +} + +/* +=============== +CG_InitUpgrades + +Precaches upgrades +=============== +*/ +void CG_InitUpgrades( ) +{ + int i; + + memset( cg_upgrades, 0, sizeof( cg_upgrades ) ); - upgradeInfo->upgradeIcon = trap_R_RegisterShader( item->icon ); + for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) + CG_RegisterUpgrade( i ); } /* @@ -576,70 +587,56 @@ CG_RegisterWeapon The server says this item is used on this level ================= */ -void CG_RegisterWeapon( int weaponNum ) { +void CG_RegisterWeapon( int weaponNum ) +{ weaponInfo_t *weaponInfo; - gitem_t *item, *ammo; - char path[MAX_QPATH]; - vec3_t mins, maxs; - int i; + char path[MAX_QPATH]; + vec3_t mins, maxs; + int i; + char *icon, *model; - weaponInfo = &cg_weapons[weaponNum]; + weaponInfo = &cg_weapons[ weaponNum ]; - if ( weaponNum == 0 ) { + if( weaponNum == 0 ) return; - } - if ( weaponInfo->registered ) { + if( weaponInfo->registered ) return; - } memset( weaponInfo, 0, sizeof( *weaponInfo ) ); weaponInfo->registered = qtrue; - for ( item = bg_itemlist + 1 ; item->classname ; item++ ) { - if ( item->giType == IT_WEAPON && item->giTag == weaponNum ) { - weaponInfo->item = item; - break; - } - } - if ( !item->classname ) { + if( !BG_FindNameForWeapon( weaponNum ) ) CG_Error( "Couldn't find weapon %i", weaponNum ); - } - CG_RegisterItemVisuals( item - bg_itemlist ); + + weaponInfo->humanName = BG_FindHumanNameForWeapon( weaponNum ); // load cmodel before model so filecache works - if( item->world_model[ 0 ] ) - weaponInfo->weaponModel = trap_R_RegisterModel( item->world_model[0] ); + if( model = BG_FindModelsForWeapon( weaponNum, 0 ) ) + weaponInfo->weaponModel = trap_R_RegisterModel( model ); // calc midpoint for rotation trap_R_ModelBounds( weaponInfo->weaponModel, mins, maxs ); - for ( i = 0 ; i < 3 ; i++ ) { + for( i = 0 ; i < 3 ; i++ ) weaponInfo->weaponMidpoint[i] = mins[i] + 0.5 * ( maxs[i] - mins[i] ); - } - weaponInfo->weaponIcon = trap_R_RegisterShader( item->icon ); - weaponInfo->ammoIcon = trap_R_RegisterShader( item->icon ); - - for ( ammo = bg_itemlist + 1 ; ammo->classname ; ammo++ ) { - if ( ammo->giType == IT_AMMO && ammo->giTag == weaponNum ) { - break; - } - } - if ( ammo->classname && ammo->world_model[0] ) { - weaponInfo->ammoModel = trap_R_RegisterModel( ammo->world_model[0] ); + if( icon = BG_FindIconForWeapon( weaponNum ) ) + { + weaponInfo->weaponIcon = trap_R_RegisterShader( icon ); + weaponInfo->ammoIcon = trap_R_RegisterShader( icon ); } - - strcpy( path, item->world_model[0] ); + + strcpy( path, model ); COM_StripExtension( path, path ); strcat( path, "_flash.md3" ); weaponInfo->flashModel = trap_R_RegisterModel( path ); - strcpy( path, item->world_model[0] ); + strcpy( path, model ); COM_StripExtension( path, path ); strcat( path, "_barrel.md3" ); weaponInfo->barrelModel = trap_R_RegisterModel( path ); - strcpy( path, item->world_model[0] ); + strcpy( path, model ); COM_StripExtension( path, path ); strcat( path, "_hand.md3" ); weaponInfo->handsModel = trap_R_RegisterModel( path ); @@ -650,215 +647,128 @@ void CG_RegisterWeapon( int weaponNum ) { weaponInfo->loopFireSound = qfalse; - switch ( weaponNum ) { - case WP_GAUNTLET: - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/melee/fstrun.wav", qfalse ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; - - case WP_TESLAGEN: - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/melee/fsthum.wav", qfalse ); - weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/lightning/lg_hum.wav", qfalse ); - - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); - cgs.media.lightningShader = trap_R_RegisterShader( "models/ammo/tesla/tesla_bolt"); - cgs.media.lightningExplosionModel = trap_R_RegisterModel( "models/weaphits/crackle.md3" ); - cgs.media.sfx_lghit = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); - break; - - case WP_GRAPPLING_HOOK: - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/rocket/rocket.md3" ); - weaponInfo->missileTrailFunc = CG_GrappleTrail; - weaponInfo->missileDlight = 200; - weaponInfo->wiTrailTime = 2000; - weaponInfo->trailRadius = 64; - MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 ); - weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/melee/fsthum.wav", qfalse ); - weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/melee/fstrun.wav", qfalse ); - break; - - case WP_MACHINEGUN: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); - weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); - weaponInfo->flashSound[2] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); - weaponInfo->flashSound[3] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); - weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass; - cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); - break; - - case WP_MASS_DRIVER: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 1 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); - weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); - weaponInfo->flashSound[2] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); - weaponInfo->flashSound[3] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); - break; - - case WP_CHAINGUN: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); - weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); - weaponInfo->flashSound[2] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); - weaponInfo->flashSound[3] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); - weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass; - cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); - break; - - case WP_SHOTGUN: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/shotgun/sshotf1b.wav", qfalse ); - weaponInfo->ejectBrassFunc = CG_ShotgunEjectBrass; - break; - - case WP_ROCKET_LAUNCHER: - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/rocket/rocket.md3" ); - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse ); - weaponInfo->missileTrailFunc = CG_RocketTrail; - weaponInfo->missileDlight = 200; - weaponInfo->wiTrailTime = 2000; - weaponInfo->trailRadius = 64; - MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 ); - MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); - cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" ); - break; + switch( weaponNum ) + { + case WP_TESLAGEN: + MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); + weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/melee/fsthum.wav", qfalse ); + weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/lightning/lg_hum.wav", qfalse ); + + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); + cgs.media.lightningShader = trap_R_RegisterShader( "models/ammo/tesla/tesla_bolt"); + cgs.media.lightningExplosionModel = trap_R_RegisterModel( "models/weaphits/crackle.md3" ); + cgs.media.sfx_lghit = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); + break; - case WP_LOCKBLOB_LAUNCHER: - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/trapper/trapper.md3" ); -/* weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse ); - weaponInfo->missileTrailFunc = CG_RocketTrail; - weaponInfo->missileDlight = 200; - weaponInfo->wiTrailTime = 2000; - weaponInfo->trailRadius = 64; - MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 ); - MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );*/ - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); - /*cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );*/ - break; + case WP_MACHINEGUN: + MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); + weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); + weaponInfo->flashSound[2] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); + weaponInfo->flashSound[3] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); + weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass; + cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); + break; - case WP_GRENADE_LAUNCHER: - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/grenade1.md3" ); - weaponInfo->missileTrailFunc = CG_GrenadeTrail; - weaponInfo->wiTrailTime = 700; - weaponInfo->trailRadius = 32; - MAKERGB( weaponInfo->flashDlightColor, 1, 0.70f, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/grenade/grenlf1a.wav", qfalse ); - cgs.media.grenadeExplosionShader = trap_R_RegisterShader( "grenadeExplosion" ); - break; + case WP_MASS_DRIVER: + MAKERGB( weaponInfo->flashDlightColor, 0, 0, 1 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); + weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); + weaponInfo->flashSound[2] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); + weaponInfo->flashSound[3] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); + break; - case WP_FLAMER: - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 0.25, 0.1, 0 ); - //weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/railgun/railgf1a.wav", qfalse ); - /*cgs.media.flameExplShader = trap_R_RegisterShader( "rocketExplosion" );*/ - break; - - case WP_PLASMAGUN: - weaponInfo->missileTrailFunc = CG_PlasmaTrail; - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse ); - cgs.media.plasmaExplosionShader = trap_R_RegisterShader( "plasmaExplosion" ); - cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); - break; + case WP_CHAINGUN: + MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); + weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); + weaponInfo->flashSound[2] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); + weaponInfo->flashSound[3] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); + weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass; + cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); + break; + + case WP_LOCKBLOB_LAUNCHER: + weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/trapper/trapper.md3" ); + /* weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse ); + weaponInfo->missileTrailFunc = CG_RocketTrail; + weaponInfo->missileDlight = 200; + weaponInfo->wiTrailTime = 2000; + weaponInfo->trailRadius = 64; + MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 ); + MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );*/ + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); + /*cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );*/ + break; - case WP_PULSE_RIFLE: - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse ); - cgs.media.plasmaExplosionShader = trap_R_RegisterShader( "plasmaExplosion" ); - cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); - break; + case WP_FLAMER: + weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); + MAKERGB( weaponInfo->flashDlightColor, 0.25, 0.1, 0 ); + //weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/railgun/railgf1a.wav", qfalse ); + /*cgs.media.flameExplShader = trap_R_RegisterShader( "rocketExplosion" );*/ + break; + + case WP_PLASMAGUN: + weaponInfo->missileTrailFunc = CG_PlasmaTrail; + weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); + MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse ); + cgs.media.plasmaExplosionShader = trap_R_RegisterShader( "plasmaExplosion" ); + cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); + break; - case WP_RAILGUN: - weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/railgun/rg_hum.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 1, 0.5f, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/railgun/railgf1a.wav", qfalse ); - cgs.media.railExplosionShader = trap_R_RegisterShader( "railExplosion" ); - cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); - cgs.media.railCoreShader = trap_R_RegisterShader( "railCore" ); - break; + case WP_PULSE_RIFLE: + weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); + MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse ); + cgs.media.plasmaExplosionShader = trap_R_RegisterShader( "plasmaExplosion" ); + cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); + break; - case WP_BFG: - weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/bfg/bfg_hum.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 1, 0.7f, 1 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/bfg/bfg_fire.wav", qfalse ); - cgs.media.bfgExplosionShader = trap_R_RegisterShader( "bfgExplosion" ); - weaponInfo->missileModel = trap_R_RegisterModel( "models/weaphits/bfg.md3" ); - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse ); - break; - - case WP_VENOM: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; + case WP_VENOM: + MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); + break; - case WP_GRABANDCSAW: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; + case WP_GRABANDCSAW: + MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); + break; - case WP_POUNCE: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; + case WP_POUNCE: + MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); + break; - case WP_ABUILD: - case WP_ABUILD2: - case WP_HBUILD: - case WP_HBUILD2: - //nowt - break; + case WP_ABUILD: + case WP_ABUILD2: + case WP_HBUILD: + case WP_HBUILD2: + //nowt + break; - default: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 1 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); - break; + default: + MAKERGB( weaponInfo->flashDlightColor, 1, 1, 1 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); + break; } } /* -================= -CG_RegisterItemVisuals +=============== +CG_InitWeapons -The server says this item is used on this level -================= +Precaches weapons +=============== */ -void CG_RegisterItemVisuals( int itemNum ) { - itemInfo_t *itemInfo; - gitem_t *item; - int i; - - if ( itemNum < 0 || itemNum >= bg_numItems ) { - CG_Error( "CG_RegisterItemVisuals: itemNum %d out of range [0-%d]", itemNum, bg_numItems-1 ); - } - - itemInfo = &cg_items[ itemNum ]; - if ( itemInfo->registered ) { - return; - } - - item = &bg_itemlist[ itemNum ]; - - memset( itemInfo, 0, sizeof( &itemInfo ) ); - itemInfo->registered = qtrue; - - itemInfo->icon = trap_R_RegisterShader( item->icon ); +void CG_InitWeapons( ) +{ + int i; - if ( item->giType == IT_WEAPON ) { - CG_RegisterWeapon( item->giTag ); - } - - for( i = 0; i < 4; i++ ) - { - if( item->world_model[ i ] ) - itemInfo->models[i] = trap_R_RegisterModel( item->world_model[i] ); - } + memset( cg_weapons, 0, sizeof( cg_weapons ) ); + for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) + CG_RegisterWeapon( i ); } @@ -1077,14 +987,14 @@ different than the muzzle point used for determining hits. */ static void CG_SpawnRailTrail( centity_t *cent, vec3_t origin ) { - if ( cent->currentState.weapon != WP_RAILGUN ) +/* if ( cent->currentState.weapon != WP_RAILGUN ) return; if ( !cent->pe.railgunFlash ) return; cent->pe.railgunFlash = qtrue; - CG_RailTrail( origin, cent->pe.railgunImpact ); + CG_RailTrail( origin, cent->pe.railgunImpact );*/ } @@ -1179,7 +1089,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent // set custom shading for railgun refire rate if ( ps ) { - if ( cg.predictedPlayerState.weapon == WP_RAILGUN +/* if ( cg.predictedPlayerState.weapon == WP_RAILGUN && cg.predictedPlayerState.weaponstate == WEAPON_FIRING ) { float f; @@ -1189,7 +1099,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent gun.shaderRGBA[0] = gun.shaderRGBA[2] = 255 * ( 1.0 - f ); } - else + else*/ { gun.shaderRGBA[0] = 255; gun.shaderRGBA[1] = 255; @@ -1261,8 +1171,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent } // add the flash - if ( ( weaponNum == WP_TESLAGEN || weaponNum == WP_GAUNTLET || weaponNum == WP_GRAPPLING_HOOK ) - && ( nonPredictedCent->currentState.eFlags & EF_FIRING ) ) + if ( ( weaponNum == WP_TESLAGEN ) && ( nonPredictedCent->currentState.eFlags & EF_FIRING ) ) { // continuous flash } else { @@ -1287,14 +1196,14 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent AnglesToAxis( angles, flash.axis ); // colorize the railgun blast - if ( weaponNum == WP_RAILGUN ) { +/* if ( weaponNum == WP_RAILGUN ) { clientInfo_t *ci; ci = &cgs.clientinfo[ cent->currentState.clientNum ]; flash.shaderRGBA[0] = 255 * ci->color1[0]; flash.shaderRGBA[1] = 255 * ci->color1[1]; flash.shaderRGBA[2] = 255 * ci->color1[2]; - } + }*/ CG_PositionRotatedEntityOnTag( &flash, &gun, weapon->weaponModel, "tag_flash"); trap_R_AddRefEntityToScene( &flash ); @@ -1480,7 +1389,7 @@ void CG_DrawWeaponSelect( void ) { BG_unpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips, &maxclips ); // no ammo cross on top - if ( !ammo && !clips && !BG_infiniteAmmo( i ) ) { + if ( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) { CG_DrawPic( x, y, 16, 16, cgs.media.noammoShader ); } @@ -1514,9 +1423,9 @@ void CG_DrawWeaponSelect( void ) { // draw the selected name if( cg.weaponSelect <= 32 ) { - if ( cg_weapons[ cg.weaponSelect ].item ) + if( cg_weapons[ cg.weaponSelect ].registered ) { - name = cg_weapons[ cg.weaponSelect ].item->pickup_name; + name = cg_weapons[ cg.weaponSelect ].humanName; if ( name ) { w = CG_DrawStrlen( name ) * BIGCHAR_WIDTH; @@ -1527,9 +1436,9 @@ void CG_DrawWeaponSelect( void ) { } else if( cg.weaponSelect > 32 ) { - if ( cg_upgrades[ cg.weaponSelect - 32 ].item ) + if( cg_upgrades[ cg.weaponSelect - 32 ].registered ) { - name = cg_upgrades[ cg.weaponSelect - 32 ].item->pickup_name; + name = cg_upgrades[ cg.weaponSelect - 32 ].humanName; if ( name ) { w = CG_DrawStrlen( name ) * BIGCHAR_WIDTH; @@ -1554,7 +1463,7 @@ static qboolean CG_WeaponSelectable( int i ) BG_unpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips, &maxclips ); - if ( !ammo && !clips && !BG_infiniteAmmo( i ) ) { + if ( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) { return qfalse; } if ( !BG_gotWeapon( i, cg.snap->ps.stats ) ) { @@ -1838,7 +1747,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im mark = cgs.media.energyMarkShader; radius = 24; break; - case WP_GRENADE_LAUNCHER: +/* case WP_GRENADE_LAUNCHER: mod = cgs.media.dishFlashModel; shader = cgs.media.grenadeExplosionShader; sfx = cgs.media.sfx_rockexp; @@ -1846,8 +1755,8 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im radius = 64; light = 300; isSprite = qtrue; - break; - case WP_ROCKET_LAUNCHER: + break;*/ +/* case WP_ROCKET_LAUNCHER: mod = cgs.media.dishFlashModel; shader = cgs.media.rocketExplosionShader; sfx = cgs.media.sfx_rockexp; @@ -1866,20 +1775,20 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im CG_ParticleExplosion( "explode1", sprOrg, sprVel, 1400, 20, 30 ); } - break; + break;*/ case WP_LOCKBLOB_LAUNCHER: sfx = cgs.media.gibBounce1Sound; mark = cgs.media.greenBloodMarkShader; radius = 64; isSprite = qtrue; break; - case WP_RAILGUN: +/* case WP_RAILGUN: mod = cgs.media.ringFlashModel; shader = cgs.media.railExplosionShader; sfx = cgs.media.sfx_plasmaexp; mark = cgs.media.energyMarkShader; radius = 24; - break; + break;*/ case WP_FLAMER: sfx = cgs.media.sfx_lghit; mark = cgs.media.burnMarkShader; @@ -1899,21 +1808,21 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im mark = cgs.media.energyMarkShader; radius = 16; break; - case WP_BFG: +/* case WP_BFG: mod = cgs.media.dishFlashModel; shader = cgs.media.bfgExplosionShader; sfx = cgs.media.sfx_rockexp; mark = cgs.media.burnMarkShader; radius = 32; isSprite = qtrue; - break; - case WP_SHOTGUN: + break;*/ +/* case WP_SHOTGUN: mod = cgs.media.bulletFlashModel; shader = cgs.media.bulletExplosionShader; mark = cgs.media.bulletMarkShader; sfx = 0; radius = 4; - break; + break;*/ case WP_MASS_DRIVER: shader = cgs.media.bulletExplosionShader; mark = cgs.media.bulletMarkShader; @@ -1953,10 +1862,10 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im duration, isSprite ); le->light = light; VectorCopy( lightColor, le->lightColor ); - if ( weapon == WP_RAILGUN ) { +/* if ( weapon == WP_RAILGUN ) { // colorize with client color VectorCopy( cgs.clientinfo[clientNum].color1, le->color ); - } + }*/ } // @@ -1966,7 +1875,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im alphaFade = ( mark == cgs.media.energyMarkShader || mark == cgs.media.greenBloodMarkShader ); - if( weapon == WP_RAILGUN ) +/* if( weapon == WP_RAILGUN ) { float *color; @@ -1974,7 +1883,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im color = cgs.clientinfo[clientNum].color2; CG_ImpactMark( mark, origin, dir, random()*360, color[0],color[1], color[2],1, alphaFade, radius, qfalse ); } - else + else*/ { CG_ImpactMark( mark, origin, dir, random()*360, 1,1,1,1, alphaFade, radius, qfalse ); } @@ -1992,10 +1901,10 @@ void CG_MissileHitPlayer( int weapon, vec3_t origin, vec3_t dir, int entityNum ) // some weapons will make an explosion with the blood, while // others will just make the blood switch ( weapon ) { - case WP_GRENADE_LAUNCHER: +/* case WP_GRENADE_LAUNCHER: case WP_ROCKET_LAUNCHER: CG_MissileHitWall( weapon, 0, origin, dir, IMPACTSOUND_FLESH ); - break; + break;*/ default: break; } @@ -2047,16 +1956,16 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum ) { } if ( cg_entities[tr.entityNum].currentState.eType == ET_PLAYER ) { - CG_MissileHitPlayer( WP_SHOTGUN, tr.endpos, tr.plane.normal, tr.entityNum ); + /*CG_MissileHitPlayer( WP_SHOTGUN, tr.endpos, tr.plane.normal, tr.entityNum );*/ } else { if ( tr.surfaceFlags & SURF_NOIMPACT ) { // SURF_NOIMPACT will not make a flame puff or a mark return; } if ( tr.surfaceFlags & SURF_METALSTEPS ) { - CG_MissileHitWall( WP_SHOTGUN, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL ); + /*CG_MissileHitWall( WP_SHOTGUN, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL );*/ } else { - CG_MissileHitWall( WP_SHOTGUN, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT ); + /*CG_MissileHitWall( WP_SHOTGUN, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT );*/ } } } |