Do not call IsHarvested() when SKSE is not loaded, added a couple SKSE checks

This commit is contained in:
Eddoursul 2024-02-07 05:55:57 +01:00
parent 02ec6d9ac3
commit 8d71367ba4
8 changed files with 6 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,8 +8,7 @@ Function Run() global
if SKSEVer == 0 if SKSEVer == 0
Utility.wait(2.0) Utility.wait(2.0)
Game.QuitToMainMenu() Game.QuitToMainMenu()
Debug.MessageBox("SKSE is not detected! Start Enderal through the launcher or skse64_loader.exe in the game directory.") Debug.MessageBox("SKSE is not detected! Start Enderal through skse64_loader.exe in the game directory.")
Return
endif endif
EndFunction EndFunction

View File

@ -119,6 +119,8 @@ bool property bCalculating = false auto hidden
bool bDeleting = false bool bDeleting = false
; don't do DisableAndDelete() a second time ; don't do DisableAndDelete() a second time
bool Property bSKSE = true Auto Hidden
;---------------------------------------------- ;----------------------------------------------
; Events ; Events
;---------------------------------------------- ;----------------------------------------------
@ -289,6 +291,7 @@ Event OnInit()
; We know default properties are good ; We know default properties are good
bDefaultPropertiesInitialized = true bDefaultPropertiesInitialized = true
bAttached = true bAttached = true
bSKSE = (SKSE.GetVersion() > 0)
; If everything else is also good, start doing stuff ; If everything else is also good, start doing stuff
CheckStateAndStart() CheckStateAndStart()
endEvent endEvent

View File

@ -326,7 +326,7 @@ ObjectReference Function PickPlant(float x, float y, float z, float searchDistan
endif endif
endif endif
if (!newPlant.IsHarvested() || IgnoreHarvestedPlants.Find(plantForm) == -1) if ! bSKSE || (!newPlant.IsHarvested() || IgnoreHarvestedPlants.Find(plantForm) == -1)
return newPlant; [USKP 2.0.1b] return newPlant; [USKP 2.0.1b]
endif endif
endif endif

View File

@ -17,7 +17,7 @@ Actor PlayerREF = Game.GetForm(0x14) as Actor
PlayerREF.RemoveAllItems(none, false, false) PlayerREF.RemoveAllItems(none, false, false)
PlayerREF.MoveTo(PlayerStartMarkerNew) PlayerREF.MoveTo(PlayerStartMarkerNew)
if EnderalFunctions.GetNewGameCount() > 1 if SKSE.GetVersion() > 0 && EnderalFunctions.GetNewGameCount() > 1
Game.QuitToMainMenu() 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.") Debug.MessageBox("Due to an engine bug, new game should not be started after quitting to the main menu. Please, restart Enderal first.")
endif endif