Skip to content

Commit

Permalink
Avoid Adjusting Destroyed Units
Browse files Browse the repository at this point in the history
- Fix for Surrender mod where destroyed units would have their health modified
  • Loading branch information
data-bomb committed May 21, 2024
1 parent 090433f commit 91a7ef3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Si_SurrenderCommand/Si_SurrenderCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You should have received a copy of the GNU General Public License
using UnityEngine;
using System.Collections.Generic;

[assembly: MelonInfo(typeof(SurrenderCommand), "Surrender Command", "1.2.5", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonInfo(typeof(SurrenderCommand), "Surrender Command", "1.2.6", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonGame("Bohemia Interactive", "Silica")]
[assembly: MelonOptionalDependencies("Admin Mod")]

Expand Down Expand Up @@ -143,6 +143,11 @@ public static void Command_Surrender(Player? callerPlayer, String args)
continue;
}

if (SurrenderTeam.Units[i].IsDestroyed)
{
continue;
}

SurrenderTeam.Units[i].DamageManager.SetHealth01(0.0f);
}
}
Expand Down

0 comments on commit 91a7ef3

Please sign in to comment.