From d044bcef4d7dd40a6f00022454e4173c73d255e3 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 20 Jun 2021 10:01:50 +0100 Subject: [PATCH] add fireevent for repaired component --- QSB/ShipSync/Patches/ShipPatches.cs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/QSB/ShipSync/Patches/ShipPatches.cs b/QSB/ShipSync/Patches/ShipPatches.cs index a6e11f4c..258c53c2 100644 --- a/QSB/ShipSync/Patches/ShipPatches.cs +++ b/QSB/ShipSync/Patches/ShipPatches.cs @@ -19,8 +19,6 @@ namespace QSB.ShipSync.Patches Prefix(nameof(InteractZone_UpdateInteractVolume)); Prefix(nameof(ShipElectricalComponent_OnEnterShip)); Prefix(nameof(ShipElectricalComponent_OnExitShip)); - Prefix(nameof(ElectricalSystem_SetPowered)); - Prefix(nameof(ElectricalComponent_SetPowered)); Prefix(nameof(ShipComponent_SetDamaged)); Prefix(nameof(ShipHull_FixedUpdate)); Prefix(nameof(ShipDamageController_OnImpact)); @@ -104,18 +102,6 @@ namespace QSB.ShipSync.Patches return false; } - public static bool ElectricalSystem_SetPowered(ElectricalSystem __instance, bool powered) - { - DebugLog.DebugWrite($"[E SYSTEM] {__instance.name} set powered {powered}"); - return true; - } - - public static bool ElectricalComponent_SetPowered(ElectricalComponent __instance, bool powered) - { - DebugLog.DebugWrite($"[E COMPONENT] {__instance.name} set powered {powered}"); - return true; - } - public static bool ShipComponent_SetDamaged(ShipComponent __instance, bool damaged, ref bool ____damaged, ref float ____repairFraction, DamageEffect ____damageEffect) { if (____damaged == damaged) @@ -137,6 +123,7 @@ namespace QSB.ShipSync.Patches ____repairFraction = 1f; __instance.GetType().GetAnyMethod("OnComponentRepaired").Invoke(__instance, null); QSBWorldSync.RaiseEvent(__instance, "OnRepaired", __instance); + QSBEventManager.FireEvent(EventNames.QSBComponentRepaired, __instance); } __instance.GetType().GetAnyMethod("UpdateColliderState").Invoke(__instance, null);