Skip to content

Commit 7a00fff

Browse files
authored
fix: event not always being disposed
1 parent 33b2277 commit 7a00fff

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/Ptr.Shared/Extensions/GameClientExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ public void PrintSayText2(string message)
5555

5656
public void PrintToCenterHtml(string message, int duration = 5)
5757
{
58-
if (InterfaceBridge.Instance.EventManager.CreateEvent("show_survival_respawn_status", true) is not
59-
{ } e)
58+
if (!self.IsValid)
6059
{
6160
return;
6261
}
6362

64-
if (!self.IsValid)
63+
if (self.IsFakeClient)
6564
{
6665
return;
6766
}
6867

69-
if (self.IsFakeClient)
68+
if (InterfaceBridge.Instance.EventManager.CreateEvent("show_survival_respawn_status", true) is not
69+
{ } e)
7070
{
7171
return;
7272
}
@@ -78,4 +78,4 @@ public void PrintToCenterHtml(string message, int duration = 5)
7878
e.Dispose();
7979
}
8080
}
81-
}
81+
}

0 commit comments

Comments
 (0)