diff --git a/src/HalfLife.UnifiedSdk.MapUpgrader.Upgrades/ConvertSuitToPCVUpgrade.cs b/src/HalfLife.UnifiedSdk.MapUpgrader.Upgrades/ConvertSuitToPCVUpgrade.cs new file mode 100644 index 0000000..278b95a --- /dev/null +++ b/src/HalfLife.UnifiedSdk.MapUpgrader.Upgrades/ConvertSuitToPCVUpgrade.cs @@ -0,0 +1,25 @@ +using HalfLife.UnifiedSdk.Utilities.Entities; +using HalfLife.UnifiedSdk.Utilities.Games; +using HalfLife.UnifiedSdk.Utilities.Tools.UpgradeTool; + +namespace HalfLife.UnifiedSdk.MapUpgrader.Upgrades +{ + /// + /// Converts item_suit's model to use w_pcv.mdl in Opposing Force maps. + /// + internal sealed class ConvertSuitToPCVUpgrade : IMapUpgradeAction + { + public void Apply(MapUpgradeContext context) + { + if (!ValveGames.OpposingForce.IsMap(context.Map.BaseName)) + { + return; + } + + foreach (var entity in context.Map.Entities.OfClass("item_suit")) + { + entity.SetModel("models/w_pcv.mdl"); + } + } + } +} diff --git a/src/HalfLife.UnifiedSdk.MapUpgrader.Upgrades/MapUpgradeBuilderExtensions.cs b/src/HalfLife.UnifiedSdk.MapUpgrader.Upgrades/MapUpgradeBuilderExtensions.cs index 936ebd2..64d8c55 100644 --- a/src/HalfLife.UnifiedSdk.MapUpgrader.Upgrades/MapUpgradeBuilderExtensions.cs +++ b/src/HalfLife.UnifiedSdk.MapUpgrader.Upgrades/MapUpgradeBuilderExtensions.cs @@ -20,6 +20,7 @@ public static MapUpgradeBuilder AddHalfLifeUpgrades(this MapUpgradeBuilder build public static MapUpgradeBuilder AddOpposingForceUpgrades(this MapUpgradeBuilder builder) { + builder.AddAction(new ConvertSuitToPCVUpgrade()); builder.AddAction(new MonsterTentacleSpawnFlagUpgrade()); builder.AddAction(new Of4a4BridgeUpgrade()); return builder;