Skip to content

Commit 1e50d27

Browse files
authored
Add missing alarm car hittable check (#960)
* Add a fallback for breakable hittables Fix: - Hittable pieces will now make a new entry if the breakable parent doesn't have one, to resolve potential overhit issues. * Fallback to classname check and remove `OnEntityDestroyed` Change: - Added back the classname check in `OnTakeDamage`, and remove unnecessary resetting in `OnEntityDestroyed`. - Minor debug message changes. * Add forgotten "prop_car_alarm" FML
1 parent b34e802 commit 1e50d27

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

9 Bytes
Binary file not shown.

addons/sourcemod/scripting/l4d2_hittable_control.sp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public Plugin myinfo =
140140
{
141141
name = "L4D2 Hittable Control",
142142
author = "Stabby, Visor, Sir, Derpduck, Forgetest",
143-
version = "0.9.2",
143+
version = "0.9.3",
144144
description = "Allows for customisation of hittable damage values (and debugging)"
145145
};
146146

@@ -415,7 +415,7 @@ Action Physics_OnTakeDamage(int victim, int &attacker, int &inflictor, float &da
415415
g_PhysicsHitInfos.SetArray(g_nPhysicsHitInfoEntry[victim], info);
416416
DebugMsg("(#%d) Physics_OnTakeDamage [%N]", victim, attacker);
417417
}
418-
else if (IsEntityClassname(attacker, "prop_physics*"))
418+
else if (IsEntityClassname(attacker, "prop_physics*") || IsEntityClassname(attacker, "prop_car_alarm"))
419419
{
420420
DebugMsg("(#%d) Physics_OnTakeDamage prop_physics (#%d)", victim, attacker);
421421

@@ -601,7 +601,7 @@ Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, in
601601
if (!IsValidEdict(attacker)
602602
|| !IsValidEdict(inflictor)
603603
|| g_nPhysicsHitInfoEntry[inflictor] == -1
604-
|| !IsEntityClassname(inflictor, "prop_physics*"))
604+
|| (!IsEntityClassname(inflictor, "prop_physics*") && !IsEntityClassname(inflictor, "prop_car_alarm")))
605605
return Plugin_Continue;
606606

607607
if (IsTank(victim) && hTankSelfDamage.BoolValue)

0 commit comments

Comments
 (0)