Skip to content

Commit

Permalink
Added additional validation to the BreakerManager
Browse files Browse the repository at this point in the history
  • Loading branch information
B3none committed Jan 19, 2024
1 parent a3800ea commit dba6a7e
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions Modules/Managers/BreakerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,49 @@ public void Handle()
{
case "func_breakable":
case "func_breakable_surf":
new PointerTo<CBreakable>(pEntity.Handle).Value.AcceptInput(action);
var breakableEntity = new PointerTo<CBreakable>(pEntity.Handle).Value;

if (breakableEntity.IsValid)
{
breakableEntity.AcceptInput(action);
}
break;

case "prop.breakable.01":
case "prop.breakable.02":
new PointerTo<CBreakableProp>(pEntity.Handle).Value.AcceptInput(action);
var breakableProp = new PointerTo<CBreakableProp>(pEntity.Handle).Value;

if (breakableProp.IsValid)
{
breakableProp.AcceptInput(action);
}
break;

case "prop_dynamic":
new PointerTo<CDynamicProp>(pEntity.Handle).Value.AcceptInput(action);
var dynamicProp = new PointerTo<CDynamicProp>(pEntity.Handle).Value;

if (dynamicProp.IsValid)
{
dynamicProp.AcceptInput(action);
}
break;

case "func_button":
new PointerTo<CBaseButton>(pEntity.Handle).Value.AcceptInput(action);
var button = new PointerTo<CBaseButton>(pEntity.Handle).Value;

if (button.IsValid)
{
button.AcceptInput(action);
}
break;

case "prop_door_rotating":
new PointerTo<CPropDoorRotating>(pEntity.Handle).Value.AcceptInput(action);
var propDoorRotating = new PointerTo<CPropDoorRotating>(pEntity.Handle).Value;

if (propDoorRotating.IsValid)
{
propDoorRotating.AcceptInput(action);
}
break;
}
break;
Expand Down

0 comments on commit dba6a7e

Please sign in to comment.