Skip to content

Commit

Permalink
Anti-Grief Game Fixes for v0.8.76+
Browse files Browse the repository at this point in the history
- Fixed to latest prototypes for OnUnitDestroyed and OnStructureDestroyed
  • Loading branch information
data-bomb committed Sep 5, 2024
1 parent e64fbe4 commit 5c1933f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Si_AntiGrief/Si_AntiGrief.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You should have received a copy of the GNU General Public License
using System.Linq;
using UnityEngine;

[assembly: MelonInfo(typeof(AntiGrief), "Anti-Grief", "1.3.1", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonInfo(typeof(AntiGrief), "Anti-Grief", "1.3.2", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonGame("Bohemia Interactive", "Silica")]
[assembly: MelonOptionalDependencies("Admin Mod")]

Expand Down Expand Up @@ -88,19 +88,19 @@ public override void OnLateInitializeMelon()
[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
{
if (__0 == null || __2 == null || _NegativeKillsThreshold == null || _NegativeKills_Penalty_Ban == null)
if (__0 == null || __1 == null || _NegativeKillsThreshold == null || _NegativeKills_Penalty_Ban == null)
{
return;
}

// Victim
Team victimTeam = __0.Team;
// Attacker
BaseGameObject attackerBase = GameFuncs.GetBaseGameObject(__2);
BaseGameObject attackerBase = GameFuncs.GetBaseGameObject(__1);

if (attackerBase == null || victimTeam == null)
{
Expand Down Expand Up @@ -187,19 +187,19 @@ public static void Postfix(StrategyMode __instance, Unit __0, EDamageType __1, U
[HarmonyPatch(typeof(MP_Strategy), nameof(MP_Strategy.OnStructureDestroyed))]
private static class ApplyPatch_OnStructureDestroyed
{
public static void Postfix(MP_Strategy __instance, Structure __0, EDamageType __1, UnityEngine.GameObject __2)
public static void Postfix(MP_Strategy __instance, Structure __0, UnityEngine.GameObject __1)
{
try
{
if (__0 == null || __2 == null)
if (__0 == null || __1 == null)
{
return;
}

// Victim
Team victimTeam = __0.Team;
// Attacker
BaseGameObject attackerBase = GameFuncs.GetBaseGameObject(__2);
BaseGameObject attackerBase = GameFuncs.GetBaseGameObject(__1);

if (attackerBase == null || victimTeam == null)
{
Expand Down

0 comments on commit 5c1933f

Please sign in to comment.