Remove unnecessary dependency injection from DoAfters (#15170)

This commit is contained in:
Leon Friedrich
2023-04-12 05:23:04 +12:00
committed by GitHub
parent fff7d485d1
commit 61b19b3164

View File

@@ -87,7 +87,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
// I feel like this is somewhat cursed, but its the only way I can think of without having to just send
// redundant data over the network and increasing DoAfter boilerplate.
var evType = typeof(DoAfterAttemptEvent<>).MakeGenericType(args.Event.GetType());
doAfter.AttemptEvent = _factory.CreateInstance(evType, new object[] { doAfter, args.Event });
doAfter.AttemptEvent = _factory.CreateInstance(evType, new object[] { doAfter, args.Event }, inject: false);
}
if (args.EventTarget != null)