diff --git a/lc-hax/Scripts/Helpers/Grabbables.cs b/lc-hax/Scripts/Helpers/Grabbables.cs index 4fc295c2..8128ed08 100644 --- a/lc-hax/Scripts/Helpers/Grabbables.cs +++ b/lc-hax/Scripts/Helpers/Grabbables.cs @@ -22,36 +22,36 @@ static void DropSFX(this GrabbableObject item) { ); } - public static void InteractWithProp(this GrabbableObject item, bool playSFX = false) { - if (Helper.LocalPlayer is PlayerControllerB localPlayer && !item.IsOwner) { - item.ChangeOwnershipOfProp(localPlayer.actualClientId); + public static void InteractWithProp(this GrabbableObject grabbable, bool playSFX = false) { + if (Helper.LocalPlayer is PlayerControllerB localPlayer && !grabbable.IsOwner) { + grabbable.ChangeOwnershipOfProp(localPlayer.actualClientId); } if (playSFX) { - item.DropSFX(); + grabbable.DropSFX(); } - if (item.TryGetComponent(out AnimatedItem animated)) { - animated.EquipItem(); + if (grabbable.TryGetComponent(out AnimatedItem animatedItem)) { + animatedItem.EquipItem(); return; } - if (item.TryGetComponent(out NoisemakerProp noiseprop)) { - noiseprop.ItemActivate(true, true); + if (grabbable.TryGetComponent(out NoisemakerProp noisemakerProp)) { + noisemakerProp.ItemActivate(true, true); return; } - if (item.TryGetComponent(out BoomboxItem BoomBox)) { - BoomBox.ItemActivate(true, true); + if (grabbable.TryGetComponent(out BoomboxItem boomboxItem)) { + boomboxItem.ItemActivate(true, true); return; } - if (item.TryGetComponent(out WhoopieCushionItem fartcushion)) { - fartcushion.Fart(); + if (grabbable.TryGetComponent(out WhoopieCushionItem whoopieCushionItem)) { + whoopieCushionItem.Fart(); return; } - item.UseItemOnClient(true); + grabbable.UseItemOnClient(true); } public static void ShootShotgun(this ShotgunItem item, Transform origin) { diff --git a/lc-hax/Scripts/Modules/TriggerMod.cs b/lc-hax/Scripts/Modules/TriggerMod.cs index 06d3745d..c7b8f8eb 100644 --- a/lc-hax/Scripts/Modules/TriggerMod.cs +++ b/lc-hax/Scripts/Modules/TriggerMod.cs @@ -92,12 +92,12 @@ void Fire() { doorLock.UnlockDoorSyncWithServer(); break; } - if (collider.TryGetComponent(out GrabbableObject prop)) { - prop.InteractWithProp(true); + + if (collider.TryGetComponent(out GrabbableObject grabbable)) { + grabbable.InteractWithProp(true); break; } - if (collider.TryGetComponent(out PlayerControllerB player)) { Helper.GetEnemy()?.ClingToPlayerServerRpc(player.playerClientId); this.PromptEnemiesToTarget(player, this.FunnyReviveEnabled)