debug check for weird timer crash

This commit is contained in:
Evil Factory
2022-06-29 20:22:33 -03:00
parent 3418132b90
commit 4a706c504a
2 changed files with 6 additions and 1 deletions
@@ -216,7 +216,7 @@ namespace Barotrauma
public static void PrintCsError(object message) => PrintErrorBase("[SV CS ERROR] ", message, "Null"); public static void PrintCsError(object message) => PrintErrorBase("[SV CS ERROR] ", message, "Null");
public static void PrintBothError(object message) => PrintErrorBase("[SV ERROR] ", message, "Null"); public static void PrintBothError(object message) => PrintErrorBase("[SV ERROR] ", message, "Null");
#else #else
private void PrintError(object message) => PrintErrorBase("[CL LUA ERROR] ", message, "nil"); public void PrintError(object message) => PrintErrorBase("[CL LUA ERROR] ", message, "nil");
public static void PrintCsError(object message) => PrintErrorBase("[CL CS ERROR] ", message, "Null"); public static void PrintCsError(object message) => PrintErrorBase("[CL CS ERROR] ", message, "Null");
public static void PrintBothError(object message) => PrintErrorBase("[CL ERROR] ", message, "Null"); public static void PrintBothError(object message) => PrintErrorBase("[CL ERROR] ", message, "Null");
#endif #endif
@@ -61,6 +61,11 @@ namespace Barotrauma
{ {
while (timedActions.Count > 0) while (timedActions.Count > 0)
{ {
if (timedActions == null)
{
throw new Exception($"timedActions was null, how is this possible? On MainThread: {GameMain.MainThread == System.Threading.Thread.CurrentThread}");
}
TimedAction timedAction = timedActions[0]; TimedAction timedAction = timedActions[0];
if (Time >= timedAction.executionTime) if (Time >= timedAction.executionTime)
{ {