|
|
|
@ -448,13 +448,15 @@ Function GoToNewPlant(float afSpeed) |
|
|
|
|
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 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") |
|
|
|
|
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)) |
|
|
|
|
BellShapeTranslateToRefNodeAtSpeedAndGotoState(CurrentPlant, firstMarkerName, adjustedBellShapePathHeight, afSpeed, fMaxRotationSpeed, "AtPlant") |
|
|
|
|
else |
|
|
|
|
; traceConditional(self + " could not find landing marker " + firstMarkerName + " on plant " + newPlant, bCritterDebug) |
|
|
|
|