From c68427eaa60f874c78e8256105517a95b5c2a2ce Mon Sep 17 00:00:00 2001 From: Pavlos Touboulidis Date: Fri, 2 May 2014 22:05:05 +0300 Subject: [PATCH] Less aggressive rules caching ActorInfo instances depend on the whole set of ActorInfos --- OpenRA.Game/GameRules/Rules.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/GameRules/Rules.cs b/OpenRA.Game/GameRules/Rules.cs index 43988885e0..c5a9a2a170 100755 --- a/OpenRA.Game/GameRules/Rules.cs +++ b/OpenRA.Game/GameRules/Rules.cs @@ -94,13 +94,15 @@ namespace OpenRA string[] files, List nodes, Func, T> f) { + string inputKey = string.Concat(string.Join("|", files), "|", nodes.WriteToString()); + var mergedNodes = files .Select(s => MiniYaml.FromFile(s)) .Aggregate(nodes, MiniYaml.MergeLiberal); Func, T> wrap = (wkv, wyy) => { - var key = wkv.Value.ToLines(wkv.Key).JoinWith("|"); + var key = inputKey + wkv.Value.ToLines(wkv.Key).JoinWith("|"); T t; if (itemCache.TryGetValue(key, out t)) return t;