Created
April 2, 2019 21:14
-
-
Save boformer/f24873a0645223a4a4a39f67cc451948 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Harmony; | |
| using ICities; | |
| using UnityEngine; | |
| namespace NoParkBuildingFires | |
| { | |
| public class Mod : IUserMod | |
| { | |
| private const string HarmonyId = "boformer.NoParkBuildingFires"; | |
| private HarmonyInstance _harmony; | |
| public string Name => "No Park Building Fires"; | |
| public string Description => "For BadPeanut"; | |
| public void OnEnabled() | |
| { | |
| if (_harmony == null) | |
| { | |
| Debug.Log("NoParkBuildingFires Patching..."); | |
| _harmony = HarmonyInstance.Create(HarmonyId); | |
| _harmony.PatchAll(GetType().Assembly); | |
| } | |
| } | |
| public void OnDisabled() | |
| { | |
| if (_harmony != null) | |
| { | |
| _harmony.UnpatchAll(HarmonyId); | |
| _harmony = null; | |
| Debug.Log("NoParkBuildingFires Reverted..."); | |
| } | |
| } | |
| } | |
| [HarmonyPatch(typeof(ParkBuildingAI), "GetFireParameters")] | |
| public static class ParkBuildingAiGetFireParametersPatch | |
| { | |
| public static void Postfix(ref bool __result) | |
| { | |
| __result = false; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment