Added a cvar to either reset the burn time when naded, or to use the original burn-time.
This commit is contained in:
parent
dd77d99eb9
commit
75d72fb3f2
@ -137,6 +137,7 @@ enum CvarsList
|
||||
Handle:CVAR_RESPAWN_TEAM_ZOMBIE,
|
||||
Handle:CVAR_RESPAWN_TEAM_ZOMBIE_WORLD,
|
||||
Handle:CVAR_NAPALM_IGNITE,
|
||||
Handle:CVAR_NAPALM_TIME_RESET,
|
||||
Handle:CVAR_NAPALM_DOUSE,
|
||||
Handle:CVAR_JUMPBOOST_BHOP_PROTECT,
|
||||
Handle:CVAR_JUMPBOOST_BHOP_MAX,
|
||||
@ -416,6 +417,7 @@ CvarsCreate()
|
||||
// Napalm (module)
|
||||
// ===========================
|
||||
g_hCvarsList[CVAR_NAPALM_IGNITE] = CreateConVar("zr_napalm_ignite", "1", "Ignite grenade in mid-air after player throws it. [Dependency: Human Attribute 'has_napalm']");
|
||||
g_hCvarsList[CVAR_NAPALM_TIME_RESET] = CreateConVar("zr_napalm_time_reset", "1", "The burn-time is reset when being naded multiple times. [0: Original burn-time is used.]");
|
||||
g_hCvarsList[CVAR_NAPALM_DOUSE] = CreateConVar("zr_napalm_douse", "0", "Minimum water-saturation before flame is extinguished. ['0' = Disabled | '1' = Feet | '2' = Waist | '3' = Full submersion]");
|
||||
|
||||
|
||||
|
@ -132,13 +132,19 @@ NapalmOnClientHurt(client, attacker, const String:weapon[])
|
||||
// If weapon is a grenade, then ignite player.
|
||||
if (StrEqual(weapon, "hegrenade", false))
|
||||
{
|
||||
// Put any existing fire out.
|
||||
new bool:reset = GetConVarBool(g_hCvarsList[CVAR_NAPALM_TIME_RESET]);
|
||||
new flags = GetEntityFlags(client);
|
||||
|
||||
if (reset || !(flags & FL_ONFIRE))
|
||||
{
|
||||
// This stops the fire before re-ignition.
|
||||
ExtinguishEntity(client);
|
||||
|
||||
// Re-ignite to start burn-time over.
|
||||
// Ignite client.
|
||||
IgniteEntity(client, napalm_time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Client has been killed.
|
||||
|
Loading…
Reference in New Issue
Block a user