From 08a71795d1dd8fec1bb4d30e026313cbf59984b3 Mon Sep 17 00:00:00 2001 From: atlimit8 Date: Sat, 11 Feb 2017 11:19:17 -0600 Subject: [PATCH] PluggableInfo.Requirements entry overrides in-use check now to allow swapping. --- OpenRA.Mods.Common/Traits/Pluggable.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Pluggable.cs b/OpenRA.Mods.Common/Traits/Pluggable.cs index 5e5c022d99..16f23af230 100644 --- a/OpenRA.Mods.Common/Traits/Pluggable.cs +++ b/OpenRA.Mods.Common/Traits/Pluggable.cs @@ -81,14 +81,11 @@ namespace OpenRA.Mods.Common.Traits public bool AcceptsPlug(Actor self, string type) { - if (active != null) - return false; - if (!Info.Conditions.ContainsKey(type)) return false; if (!Info.Requirements.ContainsKey(type)) - return true; + return active == null; return plugTypesAvailability[type]; } @@ -99,6 +96,9 @@ namespace OpenRA.Mods.Common.Traits if (!Info.Conditions.TryGetValue(type, out condition)) return; + if (conditionToken != ConditionManager.InvalidConditionToken) + conditionManager.RevokeCondition(self, conditionToken); + conditionToken = conditionManager.GrantCondition(self, condition); active = type; }