-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upgrade to convert item_suit to use w_pcv.mdl for Opposing Force …
…maps malortie/custom-hl-viewmodels#47
- Loading branch information
1 parent
1eb49ae
commit 5094a70
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/HalfLife.UnifiedSdk.MapUpgrader.Upgrades/ConvertSuitToPCVUpgrade.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
{ | ||
/// <summary> | ||
/// Converts <c>item_suit</c>'s model to use <c>w_pcv.mdl</c> in Opposing Force maps. | ||
/// </summary> | ||
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"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters