1

Moved a companion check to prevent a possible infinite loop

This commit is contained in:
Eddoursul 2022-06-23 15:50:46 +02:00
parent 6eb5841745
commit 2b1ed09b30
2 changed files with 7 additions and 5 deletions

Binary file not shown.

View File

@ -32,6 +32,7 @@ Event OnPlayerLoadGame()
Location currentLocation = PlayerRef.GetCurrentLocation() Location currentLocation = PlayerRef.GetCurrentLocation()
bAtHome = currentLocation && currentLocation.HasKeyword(LocTypePlayerHouse) bAtHome = currentLocation && currentLocation.HasKeyword(LocTypePlayerHouse)
lastDestContainer = None lastDestContainer = None
bBusy = false
EndEvent EndEvent
@ -73,6 +74,12 @@ Event OnUpdate()
Debug.Notification("Team changed, rescanning") Debug.Notification("Team changed, rescanning")
endif endif
if lastDestContainer && lastDestContainer as Actor && (lastDestContainer as Actor).IsPlayerTeammate()
lastDestContainer = None
bRescanHome = false
return
endif
if UI.IsMenuOpen("ContainerMenu") if UI.IsMenuOpen("ContainerMenu")
RegisterForMenu("ContainerMenu") RegisterForMenu("ContainerMenu")
return return
@ -91,11 +98,6 @@ Event OnUpdate()
if bRescanHome if bRescanHome
bRescanHome = false bRescanHome = false
if lastDestContainer && lastDestContainer as Actor && (lastDestContainer as Actor).IsPlayerTeammate()
lastDestContainer = None
return
endif
if lastDestContainer && lastDestContainer as PlayerBookShelfContainerScript if lastDestContainer && lastDestContainer as PlayerBookShelfContainerScript
int iLimit = 10 int iLimit = 10
while iLimit >= 0 && (lastDestContainer as PlayerBookShelfContainerScript).GetState() == "PlacingBooks" while iLimit >= 0 && (lastDestContainer as PlayerBookShelfContainerScript).GetState() == "PlacingBooks"