Skip to content

Commit

Permalink
HQLessHumansLose Game Fixes for v0.8.76+
Browse files Browse the repository at this point in the history
- Fix prototype changes for OnUnitDestroyed and OnStroctureDestroyed to remove damage type
  • Loading branch information
data-bomb committed Sep 5, 2024
1 parent f10a820 commit 39f3148
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Si_HQlessHumansLose/Si_HQlessHumansLose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ You should have received a copy of the GNU General Public License
using System;
using SilicaAdminMod;

[assembly: MelonInfo(typeof(HQlessHumansLose), "HQless Humans Lose", "1.3.8", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonInfo(typeof(HQlessHumansLose), "HQless Humans Lose", "1.3.9", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonGame("Bohemia Interactive", "Silica")]
[assembly: MelonOptionalDependencies("Admin Mod")]

Expand Down Expand Up @@ -426,7 +426,7 @@ public static void Postfix(ConstructionSite __instance)
[HarmonyPatch(typeof(MP_Strategy), nameof(MP_Strategy.OnStructureDestroyed))]
private static class ApplyPatch_OnStructureDestroyed
{
private static void Postfix(MP_Strategy __instance, Structure __0, EDamageType __1, UnityEngine.GameObject __2)
private static void Postfix(MP_Strategy __instance, Structure __0, UnityEngine.GameObject __1)
{
try
{
Expand All @@ -440,7 +440,7 @@ private static void Postfix(MP_Strategy __instance, Structure __0, EDamageType _
return;
}

MelonLogger.Msg("Structure destroyed: " + __0.name);
//MelonLogger.Msg("Structure destroyed: " + __0.name);

Team structureTeam = __0.Team;
if (structureTeam == null)
Expand All @@ -466,9 +466,9 @@ private static void Postfix(MP_Strategy __instance, Structure __0, EDamageType _

// was a human-controlled player responsible for the destruction?
destroyerOfWorlds = null;
if (__2 != null)
if (__1 != null)
{
BaseGameObject attackerBase = GameFuncs.GetBaseGameObject(__2);
BaseGameObject attackerBase = GameFuncs.GetBaseGameObject(__1);
if (attackerBase != null)
{
NetworkComponent attackerNetComp = attackerBase.NetworkComponent;
Expand All @@ -492,7 +492,7 @@ private static void Postfix(MP_Strategy __instance, Structure __0, EDamageType _
[HarmonyPatch(typeof(StrategyMode), nameof(StrategyMode.OnUnitDestroyed))]
private static class ApplyPatch_StrategyMode_OnUnitDestroyed
{
public static void Postfix(StrategyMode __instance, Unit __0, EDamageType __1, UnityEngine.GameObject __2)
public static void Postfix(StrategyMode __instance, Unit __0, UnityEngine.GameObject __1)
{
try
{
Expand All @@ -506,7 +506,7 @@ public static void Postfix(StrategyMode __instance, Unit __0, EDamageType __1, U
return;
}

MelonLogger.Msg("Unit destroyed: " + __0.name);
//MelonLogger.Msg("Unit destroyed: " + __0.name);

Team unitTeam = __0.Team;
if (unitTeam == null)
Expand All @@ -527,9 +527,9 @@ public static void Postfix(StrategyMode __instance, Unit __0, EDamageType __1, U

// was a human-controlled player responsible for the destruction?
destroyerOfWorlds = null;
if (__2 != null)
if (__1 != null)
{
BaseGameObject attackerBase = GameFuncs.GetBaseGameObject(__2);
BaseGameObject attackerBase = GameFuncs.GetBaseGameObject(__1);
if (attackerBase != null)
{
NetworkComponent attackerNetComp = attackerBase.NetworkComponent;
Expand Down

0 comments on commit 39f3148

Please sign in to comment.