Skip to content

Commit d98de58

Browse files
committed
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.
1 parent 82eec75 commit d98de58

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

60 Bytes
Binary file not shown.

addons/sourcemod/scripting/l4d2_hittable_control.sp

Lines changed: 8 additions & 1 deletion
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.1",
143+
version = "0.9.2",
144144
description = "Allows for customisation of hittable damage values (and debugging)"
145145
};
146146

@@ -373,6 +373,13 @@ void Physics_OnSpawnPost(int entity)
373373
int parent = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
374374
if (parent != -1)
375375
{
376+
// In case the breakable parent was forced to
377+
if (g_nPhysicsHitInfoEntry[parent] == -1)
378+
{
379+
g_nPhysicsHitInfoEntry[parent] = NewPhysicsHitInfo();
380+
DebugMsg("Physics_OnSpawnPost (missing info from breakable parent#%d) [#%d]", parent, g_nPhysicsHitInfoEntry[parent]);
381+
}
382+
376383
g_nPhysicsHitInfoEntry[entity] = g_nPhysicsHitInfoEntry[parent];
377384
}
378385
g_iPhysicsDamage[entity] = -1;

0 commit comments

Comments
 (0)