Skip to content

Commit fcc2083

Browse files
committed
Fixes Default Unit Errors
- Adds bounds checks in GetUnitPrefabForPlayer patch for invalid player or team inputs
1 parent 15c58cb commit fcc2083

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Si_DefaultUnits/Si_DefaultUnits.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You should have received a copy of the GNU General Public License
3535
using SilicaAdminMod;
3636
using System.Linq;
3737

38-
[assembly: MelonInfo(typeof(DefaultUnits), "Default Spawn Units", "1.0.3", "databomb", "https://github.com/data-bomb/Silica")]
38+
[assembly: MelonInfo(typeof(DefaultUnits), "Default Spawn Units", "1.0.4", "databomb", "https://github.com/data-bomb/Silica")]
3939
[assembly: MelonGame("Bohemia Interactive", "Silica")]
4040
[assembly: MelonOptionalDependencies("Admin Mod")]
4141

@@ -126,12 +126,16 @@ public static void Prefix(MP_Strategy __instance, UnityEngine.GameObject __resul
126126
{
127127
try
128128
{
129-
if (teamTechTiers == null || teamFirstSpawn == null)
129+
if (teamTechTiers == null || teamFirstSpawn == null || __0 == null)
130130
{
131131
return;
132132
}
133133

134134
Team playerTeam = __0.Team;
135+
if (playerTeam == null)
136+
{
137+
return;
138+
}
135139

136140
// was there a change in tech tier or is it the first spawn of the round for this team?
137141
if (!TechTierUpdated(playerTeam) && !teamFirstSpawn[playerTeam.Index])

0 commit comments

Comments
 (0)