Skip to content

Commit

Permalink
Fix for Doubling Starting Resources in Siege
Browse files Browse the repository at this point in the history
- Changes method of adjusting starting resources in Siege to avoid double values
  • Loading branch information
data-bomb committed Nov 17, 2024
1 parent 454fe6b commit 5467c3d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Si_Resources/Si_Resources.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 System;
using System.Linq;

[assembly: MelonInfo(typeof(ResourceConfig), "Resource Configuration", "1.3.0", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonInfo(typeof(ResourceConfig), "Resource Configuration", "1.3.1", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonGame("Bohemia Interactive", "Silica")]
[assembly: MelonOptionalDependencies("Admin Mod")]

Expand Down Expand Up @@ -179,7 +179,7 @@ public static void Command_Resources(Player? callerPlayer, String args)
[HarmonyPatch(typeof(MP_TowerDefense), nameof(MP_TowerDefense.SetTeamVersusMode))]
private static class Resources_Patch_MPTowerDefense_SetTeamVersusMode
{
public static void Postfix(MP_TowerDefense __instance, GameModeExt.ETeamsVersus __0)
public static void Prefix(MP_TowerDefense __instance, GameModeExt.ETeamsVersus __0)
{
try
{
Expand All @@ -190,9 +190,9 @@ public static void Postfix(MP_TowerDefense __instance, GameModeExt.ETeamsVersus
continue;
}

// re-adjust starting resources immediately after the game sets it
baseTeamSetup.Team.StartingResources = GetTeamStartingResources(__instance, baseTeamSetup.Team);
MelonLogger.Msg("Set starting resources for Team (" + baseTeamSetup.Team.TeamShortName + ") to " + baseTeamSetup.Team.StartingResources);
// re-adjust starting resources before it gets set to the team
baseTeamSetup.StartingResources = GetTeamStartingResources(__instance, baseTeamSetup.Team);
MelonLogger.Msg("Set starting resources for Team (" + baseTeamSetup.Team.TeamShortName + ") to " + baseTeamSetup.StartingResources);
}
}
catch (Exception error)
Expand Down

0 comments on commit 5467c3d

Please sign in to comment.