From afb4b48e91a0210f55d4a08433519d5566194f1e Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 20 Jun 2011 02:39:44 -0700 Subject: [PATCH] Hopefully fixed stacking napalm (gotta test) --- src/zr/napalm.inc | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/zr/napalm.inc b/src/zr/napalm.inc index 41c9448..f0b9515 100644 --- a/src/zr/napalm.inc +++ b/src/zr/napalm.inc @@ -84,25 +84,8 @@ NapalmOnTakeDamage(client, damagetype) { // Put the fire out. - //ExtinguishEntity(client); <-- Don't use this. Takes off the FL_ONFIRE flag, but flame doesn't get extinguished. - - // This works. - new fire = GetEntPropEnt(client, Prop_Data, "m_hEffectEntity"); - if (IsValidEntity(fire)) - { - // Make sure the entity is a flame, so we can extinguish it. - decl String:classname[64]; - GetEdictClassname(fire, classname, sizeof(classname)); - if (StrEqual(classname, "entityflame", false)) - { - SetEntPropFloat(fire, Prop_Data, "m_flLifetime", 0.0); - } - // Log what entity was in that property, for future reference. - else - { - LogEvent(false, LogType_Normal, LOG_GAME_EVENTS, LogModule_Napalm, "Napalm Douse", "Found unexpected entity in prop \"m_flLifetime\": \"%s\"", classname); - } - } + //ExtinguishEntity(client); + ExtinguishEntity2(client); return _:ACTION_CONTINUE; } @@ -113,6 +96,27 @@ NapalmOnTakeDamage(client, damagetype) return -1; } +ExtinguishEntity2(client) +{ + // This works. + new fire = GetEntPropEnt(client, Prop_Data, "m_hEffectEntity"); + if (IsValidEntity(fire)) + { + // Make sure the entity is a flame, so we can extinguish it. + decl String:classname[64]; + GetEdictClassname(fire, classname, sizeof(classname)); + if (StrEqual(classname, "entityflame", false)) + { + SetEntPropFloat(fire, Prop_Data, "m_flLifetime", 0.0); + } + // Log what entity was in that property, for future reference. + else + { + LogEvent(false, LogType_Normal, LOG_GAME_EVENTS, LogModule_Napalm, "Napalm Douse", "Found unexpected entity in prop \"m_flLifetime\": \"%s\"", classname); + } + } +} + /** * Client has been hurt. * @@ -155,8 +159,7 @@ NapalmOnClientHurt(client, attacker, const String:weapon[]) if (reset || !(flags & FL_ONFIRE)) { - // This stops the fire before re-ignition. - ExtinguishEntity(client); + ExtinguishEntity2(client); // Ignite client. IgniteEntity(client, napalm_time);