Fix do_after throwing on attaching to new entity (#1679)

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-08-16 00:03:43 +10:00
committed by GitHub
parent f791719e31
commit 845f5af7d0
3 changed files with 34 additions and 1 deletions

View File

@@ -3,8 +3,10 @@ using System;
using System.Collections.Generic;
using Content.Client.GameObjects.EntitySystems.DoAfter;
using Content.Shared.GameObjects.Components;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
@@ -38,6 +40,18 @@ namespace Content.Client.GameObjects.Components
}
}
public override void HandleMessage(ComponentMessage message, IComponent? component)
{
base.HandleMessage(message, component);
switch (message)
{
case PlayerDetachedMsg _:
_doAfters.Clear();
CancelledDoAfters.Clear();
break;
}
}
/// <summary>
/// Remove a DoAfter without showing a cancellation graphic.
/// </summary>