Jump to content

Friendly Fruitfly AI conflicting itself


CarlZalph
  • Fixed

With a change in the FindFarmPlant behaviour, the friendly fruit fly when trying to go to a crop will have the target crop plant invalid and start heading back home, for it to then go back and try to that same crop it just judged to not be good.

 

This happened recently when the changes this bit from:

        if not self.inst.planttarget or not self.inst.planttarget:IsValid() or not IsNearFollowPos(self, self.inst.planttarget) then

To:

        local plant = self.inst.planttarget
        if not plant or not plant:IsValid() or not IsNearFollowPos(self, plant) or
        not (self.validplantfn and self.validplantfn(self.inst, plant)) or not (plant.components.growable and plant.components.growable:GetCurrentStageData().tendable) then

 

Looking at FindFarmPlant:PickTarget(), it uses different logic for the component:

(plant.components.growable == nil or plant.components.growable:GetCurrentStageData().tendable)

So it'll find crops without the component, then turn around and demand that it's there.


Steps to Reproduce

Friendly Fruitfly around crops.

  • Like 2



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...