Butterflies Unchained additions, added an Is3DLoaded() check to WarpToNewPlant() in crittermoth

This commit is contained in:
Eddoursul 2024-01-25 00:22:07 +01:00
parent ad5d716e41
commit ead0fa21b8
3 changed files with 3 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -476,16 +476,17 @@ Function WarpToNewPlant()
if (newPlant != none)
; Update the current plant to the new one
currentPlant = newPlant
bool bIsLoaded = newPlant.Is3DLoaded()
; Pick random landing node
; And start moving towards it
string landingMarkerName = LandingMarkerPrefix + RandomInt(1, 3)
if (newPlant.HasNode(landingMarkerName))
if (bIsLoaded && newPlant.HasNode(landingMarkerName))
WarpToRefNodeAndGotoState(CurrentPlant, landingMarkerName, "AtPlant")
else
; traceConditional(self + " could not find landing marker " + landingMarkerName + " on plant " + newPlant, bCritterDebug)
string firstMarkerName = LandingMarkerPrefix + 1
if (newPlant.HasNode(firstMarkerName))
if (bIsLoaded && newPlant.HasNode(firstMarkerName))
WarpToRefNodeAndGotoState(CurrentPlant, firstMarkerName, "AtPlant")
else
; traceConditional(self + " could not find landing marker " + firstMarkerName + " on plant " + newPlant, bCritterDebug)