Fix DoAfter attempt event null error (#27280)
* Fix DoAfter attempt event null error * A
This commit is contained in:
@@ -73,7 +73,7 @@ public sealed partial class DoAfterAttemptEvent<TEvent> : CancellableEntityEvent
|
||||
public readonly DoAfter DoAfter;
|
||||
|
||||
/// <summary>
|
||||
/// The event that the DoAfter will raise after sucesfully finishing. Given that this event has the data
|
||||
/// The event that the DoAfter will raise after successfully finishing. Given that this event has the data
|
||||
/// required to perform the interaction, it should also contain the data required to validate/attempt the
|
||||
/// interaction.
|
||||
/// </summary>
|
||||
|
||||
@@ -104,6 +104,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
||||
doAfter.AttemptEvent = _factory.CreateInstance(evType, new object[] { doAfter, args.Event });
|
||||
}
|
||||
|
||||
args.Event.DoAfter = doAfter;
|
||||
if (args.EventTarget != null)
|
||||
RaiseLocalEvent(args.EventTarget.Value, doAfter.AttemptEvent, args.Broadcast);
|
||||
else
|
||||
|
||||
@@ -245,8 +245,9 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
||||
if (args.AttemptFrequency == AttemptFrequency.StartAndEnd && !TryAttemptEvent(doAfter))
|
||||
return false;
|
||||
|
||||
if (args.Delay <= TimeSpan.Zero ||
|
||||
_tag.HasTag(args.User, "InstantDoAfters"))
|
||||
// TODO DO AFTER
|
||||
// Why does this tag exist? Just make this a bool on the component?
|
||||
if (args.Delay <= TimeSpan.Zero || _tag.HasTag(args.User, "InstantDoAfters"))
|
||||
{
|
||||
RaiseDoAfterEvents(doAfter, comp);
|
||||
// We don't store instant do-afters. This is just a lazy way of hiding them from client-side visuals.
|
||||
|
||||
Reference in New Issue
Block a user