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);
}
var writesAttribute = GetType().GetCustomAttribute<Writes>(false);
if (writesAttribute != null)
var writesAttributes = GetType().GetCustomAttributes<Writes>(false);
foreach (var writesAttribute in writesAttributes)
{
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);