diff --git a/Tests/ValueDelete.cfg b/Tests/ValueDelete.cfg index b4c15e89..f18f1f16 100644 --- a/Tests/ValueDelete.cfg +++ b/Tests/ValueDelete.cfg @@ -23,6 +23,8 @@ MMTEST -multiVal = dummy // Indexed -multiVal2,0 = dummy + // Wildcard + -num*ic = dummy } } @@ -35,7 +37,6 @@ MMTEST_EXPECT { name = module1 multiVal2 = two - numeric = 0 } } } \ No newline at end of file diff --git a/moduleManager.cs b/moduleManager.cs index 3214e513..cb7a7ce2 100644 --- a/moduleManager.cs +++ b/moduleManager.cs @@ -589,7 +589,20 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod) if (v != null) newNode.values.Remove(v); } - else + else if (valName.Contains('*') || valName.Contains('?')) + { + // Delete all matching wildcard + ConfigNode.Value last = null; + while (true) + { + ConfigNode.Value v = FindValueIn(newNode, valName, index++); + if (v == last) + break; + last = v; + newNode.values.Remove(v); + } + } + else { // Default is to delete ALL values that match. (backwards compatibility) newNode.RemoveValues(valName);