on fire checking in client game is usually the function CG_EntOnFire( centity_t *cent)
CG_AddRefEntityWithPowerups would be where you want for onfire, but for q3-style pws you want…
/*
===============
CG_PlayerPowerups
===============
*/
static void CG_PlayerPowerups( centity_t *cent, refEntity_t *torso ) {
int powerups;
clientInfo_t *ci;
powerups = cent->currentState.powerups;
if ( !powerups ) {
return;
}
// quad gives a dlight
if ( powerups & ( 1 << PW_QUAD ) ) {
if ( cgs.gametype == GT_ACTF || cgs.gametype == GT_TEAM ) {
if ( cgs.clientinfo[ cent->currentState.clientNum ].team == TEAM_RED ) {
trap_R_AddLightToScene( cent->lerpOrigin, 200 + (rand()&31), 1, 0.2f, 0.2f );
} else {
trap_R_AddLightToScene( cent->lerpOrigin, 200 + (rand()&31), 0.2f, 0.2f, 1 );
}
}
}
}
now in CG_Player… add the following:
// add powerups floating behind the player
CG_PlayerPowerups( cent, &torso );
note: that should go below this if statement:
//
// add the gun / barrel / flash
//
for the weapons, it will get a bit more ugly… in cg_weapons.c find CG_AddPlayerWeapon
add this above it:
/*
========================
CG_AddWeaponWithPowerups
========================
*/
static void CG_AddWeaponWithPowerups( refEntity_t *gun, int powerups, int team ) {
// add powerup effects
if ( powerups & ( 1 << PW_INVIS ) ) {
gun->customShader = cgs.media.invisShader;
trap_R_AddRefEntityToScene( gun );
} else {
trap_R_AddRefEntityToScene( gun );
if ( powerups & ( 1 << PW_BATTLESUIT ) ) {
gun->customShader = cgs.media.battleWeaponShader;
trap_R_AddRefEntityToScene( gun );
}
if ( powerups & ( 1 << PW_QUAD ) ) {
if (team == TEAM_RED) {
gun->customShader = cgs.media.redquadWeaponShader;
}
else {
gun->customShader = cgs.media.quadWeaponShader;
}
trap_R_AddRefEntityToScene( gun );
}
if ( powerups & ( 1 << PW_FLIGHT ) ) {
gun->customShader = cgs.media.flightWeaponShader;
trap_R_AddRefEntityToScene( gun );
}
}
}
remove the pws or add as needed…
now in CG_AddPlayerWeapon,
your gonna have to go looking in the q3 cg_weapons.c in that function for where that is defined… you want it for &gun as cent and &barrel for sure.