Skip to content

Instantly share code, notes, and snippets.

@boformer
Created April 16, 2019 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boformer/fe4c9ce55258f4f0e3f0c127b96a574e to your computer and use it in GitHub Desktop.
Save boformer/fe4c9ce55258f4f0e3f0c127b96a574e to your computer and use it in GitHub Desktop.
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