fix crash on multiple write declarations

pull/5/head
Evan Hemsley 2019-08-21 19:21:55 -07:00
parent fa9000590b
commit dd22c00072
1 changed files with 3 additions and 3 deletions

View File

@ -31,11 +31,11 @@ namespace Encompass
sendTypes.UnionWith(activatesAttribute.writePendingTypes); sendTypes.UnionWith(activatesAttribute.writePendingTypes);
} }
var writesAttribute = GetType().GetCustomAttribute<Writes>(false); var writesAttributes = GetType().GetCustomAttributes<Writes>(false);
if (writesAttribute != null) foreach (var writesAttribute in writesAttributes)
{ {
sendTypes.UnionWith(writesAttribute.writeTypes); sendTypes.UnionWith(writesAttribute.writeTypes);
writePriorities = writesAttribute.priorities; writePriorities = new Dictionary<Type, int>[2] { writePriorities, writesAttribute.priorities }.SelectMany(dict => dict).ToDictionary(pair => pair.Key, pair => pair.Value);
} }
var receivesAttribute = GetType().GetCustomAttribute<Receives>(false); var receivesAttribute = GetType().GetCustomAttribute<Receives>(false);