Created
April 16, 2019 14:28
-
-
Save boformer/fe4c9ce55258f4f0e3f0c127b96a574e to your computer and use it in GitHub Desktop.
This file contains 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