thermite grenades - almost finished code


(jamez) #1

ok, i have almost finished the thermite nades, if anybody knows the location in the client side code where the smoke grenades smoke gets drawn i can finish it
here is what i have so far

finished server side code:


void weapon_smokeBombExplode( gentity_t *ent ) {
	int lived=0;
	float i, j, k;

	gentity_t *tent;

	i = 0;
	j = 0;
	k = 0;

	if( !ent->grenadeExplodeTime )
		ent->grenadeExplodeTime = level.time;

	lived = level.time - ent->grenadeExplodeTime;
	ent->nextthink = level.time + INTERVAL;

	if( lived < FLAMETIME ) {
		// Just been thrown, increase radius
		VectorUnSet(ent->r.currentAngles, i, j, k);
		if (k>1.0f) {
			j+=0.3f;
			k=0.0f;
			goto leaveloop;
		}
		if (j>1.0f) {
			i+=0.3f;
			j=0.0f;
			goto leaveloop;
		}
		if (i>1.0f) {
			i=0.0f;
		}
		VectorSet(ent->r.currentAngles, i, j, k);
	/*	for (i=0;i>1;i+=0.3){
			for (j=0;j>1;j+=0.3){
				for (k=0;k>1;k+=0.3){
					VectorSet(ent->r.currentAngles, i, j, k);
				}
			}
		}*/ //<- ref code for the fire spinning
leaveloop:;
		fire_flamechunk(ent, ent->r.currentOrigin, ent->r.currentAngles);
	} else {
		// Poof and it's gone
		G_FreeEntity( ent );
	}
}

on the client side:
call this to make fire appear (only visual)


CG_FireFlameChunks( cent, flash.origin, angles, 1.0, qfalse );

and is anybody else experienceing some major shit were preview goes to another site no matter what?


(jamez) #2

:bump:

does anybody at all know where the smoke comes out on the client side? i dont care even if ur wrong, i just want a general pointer to where aobuts i should look


(bacon) #3

cg_effects.c (around line 1430)

void CG_RenderSmokeGrenadeSmoke( centity_t *cent, const weaponInfo_t *weapon ) {
	...
}

(jamez) #4

thanks, i compiled my changes but they didnt work, ill post the code as soon as i get it working


([RW]FRED) #5

For incendiary nades, look at SOF2 SDK, U have the code to implement server & client sides

Regards