fix crash on multiple write declarations
parent
fa9000590b
commit
dd22c00072
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue