From 55202ebf0b22eddb122d43e26c3f90fcb2cb9736 Mon Sep 17 00:00:00 2001 From: MSWS Date: Thu, 5 Sep 2024 23:07:48 -0700 Subject: [PATCH] Fix test issues --- GangsAPI/Data/Command/CommandInfoWrapper.cs | 10 ++++------ GangsAPI/Data/PlayerWrapper.cs | 8 ++++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/GangsAPI/Data/Command/CommandInfoWrapper.cs b/GangsAPI/Data/Command/CommandInfoWrapper.cs index 4964628..8be4c80 100644 --- a/GangsAPI/Data/Command/CommandInfoWrapper.cs +++ b/GangsAPI/Data/Command/CommandInfoWrapper.cs @@ -44,11 +44,9 @@ public void ReplySync(string message) { return; } - Server.NextFrame(() => { - if (CallingContext == CommandCallingContext.Console) - CallingPlayer.PrintToConsole(message); - else - CallingPlayer.PrintToChat(message); - }); + if (CallingContext == CommandCallingContext.Console) + CallingPlayer.PrintToConsole(message); + else + CallingPlayer.PrintToChat(message); } } \ No newline at end of file diff --git a/GangsAPI/Data/PlayerWrapper.cs b/GangsAPI/Data/PlayerWrapper.cs index 157a844..acf3e74 100644 --- a/GangsAPI/Data/PlayerWrapper.cs +++ b/GangsAPI/Data/PlayerWrapper.cs @@ -114,7 +114,9 @@ public void PrintToChat(string message) { return; } - Server.NextFrame(() => Player.PrintToChat(message)); + Server.NextFrame(() => { + if (Player.IsValid) Player.PrintToChat(message); + }); } public void PrintToConsole(string message) { @@ -124,6 +126,8 @@ public void PrintToConsole(string message) { return; } - Server.NextFrame(() => Player.PrintToConsole(message)); + Server.NextFrame(() => { + if (Player.IsValid) Player.PrintToConsole(message); + }); } } \ No newline at end of file