Skip to content

Commit

Permalink
Create BuildingPatches.cs (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettluskey committed Jun 10, 2023
1 parent 2258bee commit c0d9a82
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions source/GameInterface/Services/Buildings/Patches/BuildingPatches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using HarmonyLib;
using TaleWorlds.CampaignSystem.Settlements.Buildings;

namespace GameInterface.Services.Buildings.Patches
{
/// <summary>
/// Disables functionality for <see cref="Building"/>
/// </summary>
[HarmonyPatch(typeof(Building))]
internal class BuildingPatches
{
[HarmonyPatch(nameof(Building.CurrentLevel), MethodType.Setter)]
[HarmonyPrefix]
private static bool CurrentLevelPrefix()
{
return false;
}

[HarmonyPatch(nameof(Building.LevelUp))]
[HarmonyPrefix]
private static bool LevelUpPrefix()
{
return false;
}

[HarmonyPatch(nameof(Building.LevelDown))]
[HarmonyPrefix]
private static bool LevelDownPrefix()
{
return false;
}

[HarmonyPatch(nameof(Building.HitPointChanged))]
[HarmonyPrefix]
private static bool HitPointChangedPrefix()
{
return false;
}
}
}

0 comments on commit c0d9a82

Please sign in to comment.