PluggableInfo.Requirements entry overrides in-use check now to allow swapping.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user