OBT/1.0.15
* Removed PF support again Fixed Object reference not set to an instance of an object exception in EnemyAIController.cs UpdateLimbAttack() * Reverted pervious fix on EnemyAIController bcuz the fix will not fix anything Reduced MaxDegreeOfParallelism by 1 bcuz already a task there * Re-removed all PF related stuff to fix issue Removed all RUN_PHYSICS_IN_SEPARATE_THREAD related code because these codes are no longer functional Removed a duplicated loop in GameScreen Removed mulitple unnessary parallel operations * Potentially fixed #44 and #43 * added a ToList for Gap.GapList
This commit is contained in:
@@ -9,16 +9,27 @@ namespace Barotrauma
|
||||
|
||||
public static SingleThreadWorker GlobalWorker = new SingleThreadWorker();
|
||||
|
||||
/// <summary>
|
||||
/// Initilize a SingleThreadWorker
|
||||
/// SingleThreadWorker or STW for short is a FIFO queue ensure single-thread execution of a series of actions.
|
||||
/// </summary>
|
||||
public SingleThreadWorker()
|
||||
{
|
||||
ActionQueue = new ConcurrentQueue<Action>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a pending action in a STW queue
|
||||
/// </summary>
|
||||
/// <param name="action"></param>
|
||||
public void AddAction(Action action)
|
||||
{
|
||||
ActionQueue.Enqueue(action);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run all pending actions in the STW queue
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
public void RunActions()
|
||||
{
|
||||
@@ -32,8 +43,9 @@ namespace Barotrauma
|
||||
{
|
||||
// Just try-catch and do nothing but print errorlogs. We cannot afford crashing the game.
|
||||
ConsoleColor originalForeground = Console.ForegroundColor;
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"WARNING: Error occurred when running Single Thread Actions \n{e}");
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.WriteLine($"WARNING: Error occurred when running Single Thread Actions. " +
|
||||
$"If the server didn't crash or stop responding then this should be fine \n{e}");
|
||||
Console.ForegroundColor = Console.ForegroundColor;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user