Prevent users from starting game twice during the same session to avoid an engine bug

This commit is contained in:
Eddoursul 2022-07-28 16:38:24 +02:00
parent 0121c3cd13
commit 3b5bc3fffe
4 changed files with 9 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -20,6 +20,13 @@ Function SetUpScene()
MQP01_DreamDoorREF.BlockActivation(True) MQP01_DreamDoorREF.BlockActivation(True)
Wait(5.0) Wait(5.0)
Game.EnablePlayerControls() Game.EnablePlayerControls()
if EnderalLib.NewGameCount() > 1
Game.QuitToMainMenu()
Debug.MessageBox("Due to an engine bug, new game should not be started after quitting to the main menu. Please, restart Enderal first.")
return
endif
Game.DisablePlayerControls(false, true, true, false, true, false, false) Game.DisablePlayerControls(false, true, true, false, true, false, false)
Wait(1.0) Wait(1.0)
_00E_MQP01_Thoughts01.ShowAsHelpMessage("Empty", 5, 1, 1) _00E_MQP01_Thoughts01.ShowAsHelpMessage("Empty", 5, 1, 1)

View File

@ -4,6 +4,8 @@ float function calculateContentStrength(ObjectReference container) native global
Potion function CreatePotion(MagicEffect[] effects, float[] magnitudes, int[] areas, int[] durations, int arraySize) native global Potion function CreatePotion(MagicEffect[] effects, float[] magnitudes, int[] areas, int[] durations, int arraySize) native global
int function NewGameCount() native global
bool function IsDLLLoaded() global bool function IsDLLLoaded() global
return (SKSE.GetPluginVersion("fs_skse_functions") != -1) return (SKSE.GetPluginVersion("fs_skse_functions") != -1)
endfunction endfunction