Fix cs enabled for session state not being preserved between reloads

This commit is contained in:
Evil Factory
2026-04-08 20:12:20 -03:00
parent b9b457262f
commit 3a5fbfde1e
2 changed files with 7 additions and 1 deletions

View File

@@ -129,7 +129,7 @@ namespace Barotrauma
new GUITextBlock(new RectTransform(new Vector2(1f, 1f), packageFrame.RectTransform), package.Name);
}
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0f), msgBoxLayout.RectTransform), "CSharp mods are not sandboxed, meaning that they have unrestrictive access to your computer, please make sure you trust these mods before you continue. If you are not hosting a server, selecting cancel will only run Lua-mods.", wrap: true)
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0f), msgBoxLayout.RectTransform), "C# mods are not sandboxed, meaning that they have unrestrictive access to your computer, please make sure you trust these mods before you continue. If you are not hosting a server, selecting cancel will only run Lua mods.", wrap: true)
{
Wrap = true
};

View File

@@ -230,8 +230,14 @@ namespace Barotrauma
CoroutineManager.Invoke(() =>
{
#if CLIENT
bool prevCsEnabled = _isCsEnabledForSession;
#endif
var state = CurrentRunState;
SetRunState(RunState.Unloaded);
#if CLIENT
_isCsEnabledForSession = prevCsEnabled;
#endif
SetRunState(state);
});
}