diff --git a/source/client/main.qc b/source/client/main.qc index 4c52d42..5696b2c 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -1403,6 +1403,17 @@ noref void() CSQC_Parse_Event = if (cvar("nzp_particles")) pointparticles(particleeffectnum("blood.blood_particle"), loc, '0 0 0', 1); break; + case EVENT_FLAME: + vector floc; + + floc_x = readcoord(); + floc_y = readcoord(); + floc_z = readcoord(); + + if (cvar("nzp_particles")) { + pointparticles(particleeffectnum("flames.flame_particle"), floc, '0 0 0', 1); + } + break; case EVENT_LIMBGIB: vector gloc; diff --git a/source/server/ai/dog_core.qc b/source/server/ai/dog_core.qc index 124d6e8..e614988 100644 --- a/source/server/ai/dog_core.qc +++ b/source/server/ai/dog_core.qc @@ -157,18 +157,8 @@ void() Dog_Think = // Play particles if we're on fire if (self.onfire) { - -#ifdef FTE - - te_flamejet(self.origin, v_up*8, 10); - -#else - - particle (self.origin, v_up*8, 0, 0); - -#endif // FTE + Effect_Fire(self.origin); } - } float dogCount; diff --git a/source/server/clientfuncs.qc b/source/server/clientfuncs.qc index 63d1620..69ce901 100644 --- a/source/server/clientfuncs.qc +++ b/source/server/clientfuncs.qc @@ -647,6 +647,28 @@ void(entity who, float version) nzp_setdoubletapver = #endif // FTE +void(vector org) Effect_Fire = +{ + +#ifndef FTE + + particle (self.origin, v_up*8, 111, 0); + +#else + + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EVENT_FLAME); + WriteCoord(MSG_MULTICAST, org_x); + WriteCoord(MSG_MULTICAST, org_y); + WriteCoord(MSG_MULTICAST, org_z); + multicast('0 0 0', MULTICAST_ALL); + + //te_flamejet(self.origin, v_up*8, 10); + +#endif // FTE + +}; + // ***************************************** // Unrelated to engine, but custom functions // ***************************************** diff --git a/source/server/entities/explosive_barrel.qc b/source/server/entities/explosive_barrel.qc index f0a6ca5..b8afd84 100644 --- a/source/server/entities/explosive_barrel.qc +++ b/source/server/entities/explosive_barrel.qc @@ -54,17 +54,7 @@ void() Barrel_Think = { // Spawn the flame particles if (self.ltime > 10) { - -#ifndef FTE - - particle (self.origin, v_up, 111, 0); - -#else - - te_flamejet(self.origin + '0 0 45', v_up, 10); - -#endif // FTE - + Effect_Fire(self.origin + '0 0 45'); self.ltime = 0; } self.ltime++; diff --git a/source/server/entities/map_entities.qc b/source/server/entities/map_entities.qc index a468d3a..dddca53 100644 --- a/source/server/entities/map_entities.qc +++ b/source/server/entities/map_entities.qc @@ -28,33 +28,17 @@ string(float wep, float gorvmodel) GetWeaponModel; void() ReturnWeaponModel; -void() flame_update = { - -#ifndef FTE - - particle (self.origin, v_up, 111, 0); - -#else - - te_flamejet(self.origin, v_up, 10); - -#endif // FTE +void() flame_update = +{ + Effect_Fire(self.origin); self.think = flame_update; self.nextthink = time + random()+0.1; } + void() place_fire = { - -#ifndef FTE - - particle (self.origin, v_up*8, self.frame, 0); - -#else - - te_flamejet(self.origin, v_up*8, 10); - -#endif // FTE + Effect_Fire(self.origin); self.think = flame_update; self.nextthink = time + random()+0.1; diff --git a/source/server/weapons/flamethrower.qc b/source/server/weapons/flamethrower.qc index 8b6bf70..acea749 100644 --- a/source/server/weapons/flamethrower.qc +++ b/source/server/weapons/flamethrower.qc @@ -33,16 +33,7 @@ // void() Flame_LingerThink = { - -#ifdef FTE - - te_flamejet(self.origin, v_up*8, 5); - -#else - - particle (self.origin, v_up*8, 0, 0); - -#endif // FTE + Effect_Fire(self.origin); if (self.ltime < time) remove(self); diff --git a/source/shared/defs/custom.qc b/source/shared/defs/custom.qc index 08b75fa..10f83d4 100644 --- a/source/shared/defs/custom.qc +++ b/source/shared/defs/custom.qc @@ -60,6 +60,7 @@ const float EVENT_BETTYPROMPT = 43; const float EVENT_LIMBGIB = 44; const float EVENT_CHATMESSAGE = 45; const float EVENT_DOUBLETAPUPDATE = 46; +const float EVENT_FLAME = 47; // Define our FTE platform #ifndef STANDARD