do_after fixes (#3299)

* Try fixing DoAfterBar coordinates issue

Also I have a somewhat shitcode way to ensure it doesn't get stuck but I'll wait to see if it still happens on live.

* Brute force fix the stuck issue

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-02-25 11:32:41 +11:00
committed by GitHub
parent adbcfbb951
commit 94bdf01ab7
2 changed files with 38 additions and 12 deletions

View File

@@ -51,7 +51,7 @@ namespace Content.Client.GameObjects.Components
/// </summary>
public void Enable()
{
if (Gui != null && !Gui.Disposed)
if (Gui?.Disposed == false)
return;
Gui = new DoAfterGui {AttachedEntity = Owner, FirstDraw = true};
@@ -70,6 +70,7 @@ namespace Content.Client.GameObjects.Components
public void Disable()
{
Gui?.Dispose();
Gui = null;
}
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
@@ -128,8 +129,7 @@ namespace Content.Client.GameObjects.Components
/// <param name="clientDoAfter"></param>
public void Remove(ClientDoAfter clientDoAfter)
{
if (_doAfters.ContainsKey(clientDoAfter.ID))
_doAfters.Remove(clientDoAfter.ID);
_doAfters.Remove(clientDoAfter.ID);
var found = false;