Added a Is3DLoaded() check to critterMoth
This commit is contained in:
parent
3805291636
commit
31646a4eac
Binary file not shown.
@ -448,13 +448,15 @@ Function GoToNewPlant(float afSpeed)
|
|||||||
string landingMarkerName = LandingMarkerPrefix + RandomInt(1, 3)
|
string landingMarkerName = LandingMarkerPrefix + RandomInt(1, 3)
|
||||||
float newPlantDistance = Math.sqrt(Math.pow(newPlantX - self.GetPositionX(), 2) + Math.pow(newPlantY - self.GetPositionY(), 2) + Math.pow(newPlantZ - self.GetPositionZ(), 2))
|
float newPlantDistance = Math.sqrt(Math.pow(newPlantX - self.GetPositionX(), 2) + Math.pow(newPlantY - self.GetPositionY(), 2) + Math.pow(newPlantZ - self.GetPositionZ(), 2))
|
||||||
float adjustedBellShapePathHeight = fBellShapePathHeight - (fBellShapePathHeight * (Math.pow(0.995, newPlantDistance)))
|
float adjustedBellShapePathHeight = fBellShapePathHeight - (fBellShapePathHeight * (Math.pow(0.995, newPlantDistance)))
|
||||||
if (newPlant.HasNode(landingMarkerName))
|
|
||||||
|
bool bIsLoaded = newPlant.Is3DLoaded()
|
||||||
|
if (bIsLoaded && newPlant.HasNode(landingMarkerName))
|
||||||
BellShapeTranslateToRefNodeAtSpeedAndGotoState(CurrentPlant, landingMarkerName, adjustedBellShapePathHeight, afSpeed, fMaxRotationSpeed, "AtPlant")
|
BellShapeTranslateToRefNodeAtSpeedAndGotoState(CurrentPlant, landingMarkerName, adjustedBellShapePathHeight, afSpeed, fMaxRotationSpeed, "AtPlant")
|
||||||
else
|
else
|
||||||
; traceConditional(self + " could not find landing marker " + landingMarkerName + " on plant " + newPlant, bCritterDebug)
|
; traceConditional(self + " could not find landing marker " + landingMarkerName + " on plant " + newPlant, bCritterDebug)
|
||||||
|
|
||||||
string firstMarkerName = LandingMarkerPrefix + 1
|
string firstMarkerName = LandingMarkerPrefix + 1
|
||||||
if (newPlant.HasNode(firstMarkerName))
|
if (bIsLoaded && newPlant.HasNode(firstMarkerName))
|
||||||
BellShapeTranslateToRefNodeAtSpeedAndGotoState(CurrentPlant, firstMarkerName, adjustedBellShapePathHeight, afSpeed, fMaxRotationSpeed, "AtPlant")
|
BellShapeTranslateToRefNodeAtSpeedAndGotoState(CurrentPlant, firstMarkerName, adjustedBellShapePathHeight, afSpeed, fMaxRotationSpeed, "AtPlant")
|
||||||
else
|
else
|
||||||
; traceConditional(self + " could not find landing marker " + firstMarkerName + " on plant " + newPlant, bCritterDebug)
|
; traceConditional(self + " could not find landing marker " + firstMarkerName + " on plant " + newPlant, bCritterDebug)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user