diff --git a/README.md b/README.md index 19898e7..c955ec9 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,9 @@ What does 2 mean, you ask? It's simple! A standard 2x2 floor piece has a length of 2, exactly like its name suggests. # Changelog -## 1.2.2 +## 1.2.3 + - Fixed a bug that allowed players to veinmine (and gain exp) without a pickaxe. +### 1.2.2 - Possible fix for ore drop quantities (Not sure why they weren't correct, as I don't change drop rates) ### 1.2.1 - Compatibility for Hearth and Home; diff --git a/VeinMine/Patches.cs b/VeinMine/Patches.cs index 5e23f48..76de94f 100644 --- a/VeinMine/Patches.cs +++ b/VeinMine/Patches.cs @@ -66,7 +66,7 @@ public static void MineRock5_Damage_Patch(MineRock5 __instance, ZNetView ___m_nv { if (Player.m_localPlayer != null && hit.m_attacker == Player.m_localPlayer.GetZDOID()) { - if (Input.GetKey(VeinMine.veinMineKey.Value)) + if (Input.GetKey(VeinMine.veinMineKey.Value) && Player.m_localPlayer.GetCurrentWeapon().GetDamage().m_pickaxe > 0) { foreach (var index in __state) { @@ -95,7 +95,7 @@ public static void MineRock5_Damage_Patch(MineRock5 __instance, ZNetView ___m_nv [HarmonyPatch(typeof(MineRock5), "DamageArea")] public static bool MineRock5_DamageArea_Prefix(MineRock5 __instance, HitData hit, int hitAreaIndex, ref EffectList ___m_destroyedEffect, ref EffectList ___m_hitEffect, out float __state, ref bool __result) { - if (!VeinMine.progressiveMode.Value) hit.m_damage.m_pickaxe = __instance.m_health; + if (!VeinMine.progressiveMode.Value && Player.GetClosestPlayer(hit.m_point, 10f).GetCurrentWeapon().GetDamage().m_pickaxe > 0f) hit.m_damage.m_pickaxe = __instance.m_health; bool isVeinmined = false; MineRock5.HitArea hitArea = __instance.GetHitArea(hitAreaIndex); __state = hitArea.m_health; @@ -178,7 +178,7 @@ public static bool MineRock5_DamageArea_Prefix(MineRock5 __instance, HitData hit [HarmonyPatch(typeof(MineRock5), "DamageArea")] public static void MineRock5_DamageArea_Patch(MineRock5 __instance, HitData hit, float __state, bool __result) { - if (Input.GetKey(VeinMine.veinMineKey.Value)) + if (Input.GetKey(VeinMine.veinMineKey.Value) && Player.m_localPlayer.GetCurrentWeapon().GetDamage().m_pickaxe > 0) { if (__state > 0f && hit.m_attacker == Player.m_localPlayer.GetZDOID() && !VeinMine.progressiveMode.Value) { diff --git a/VeinMine/Properties/AssemblyInfo.cs b/VeinMine/Properties/AssemblyInfo.cs index 43664ad..caa9ff5 100644 --- a/VeinMine/Properties/AssemblyInfo.cs +++ b/VeinMine/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.2.0")] -[assembly: AssemblyFileVersion("1.2.2.0")] +[assembly: AssemblyVersion("1.2.3.0")] +[assembly: AssemblyFileVersion("1.2.3.0")] diff --git a/VeinMine/VeinMine.cs b/VeinMine/VeinMine.cs index c836a51..b02e4a1 100644 --- a/VeinMine/VeinMine.cs +++ b/VeinMine/VeinMine.cs @@ -14,7 +14,7 @@ public class VeinMine : BaseUnityPlugin { private const string MOD_ID = "com.wisehorror.Veinmine"; private const string MOD_NAME = "Veinmine"; - private const string VERSION = "1.2.2"; + private const string VERSION = "1.2.3"; public static ManualLogSource logger = BepInEx.Logging.Logger.CreateLogSource("Veinmine");