Jump to content

Feeding spiders tames less if friendly spiders are closer than wild spiders to fed target


Electroely
  • Fixed

unknown.png

unknown.png

Notice how in the first image, there's a wild spider, 3 tame spiders, then 2 wild ones.

Now, normally, if I feed a spider, I would tame 3 at once. So I fed the one on the left, but only THAT spider got tamed. The rest are still wild.


Steps to Reproduce

1. Have some friendly spiders
2. Feed a wild spider while a friendly spider is closer to it than another wild spider
3. Notice how you tame less than 3 spiders per meat despite the fact that there are enough nearby spiders

  • Like 7



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.

A possible fix would be changing lines 125-153 in spider.lua to this.
So that the maxSpiders value will only decrease if the spider does not already have a leader.

Quote

if giver.components.leader ~= nil then
    local spiders = GetOtherSpiders(inst, 15)
    local maxSpiders = TUNING.SPIDER_FOLLOWER_COUNT

    for i, v in ipairs(spiders) do
        if v ~= inst and not v.components.follower. then
            if maxSpiders <= 0 then
                break
            end

            if v.components.combat.target == giver then
                v.components.combat:SetTarget(nil)
            elseif giver.components.leader ~= nil and
                v.components.follower ~= nil and
                v.components.follower.leader == nil then
                if not playedfriendsfx then
                    giver:PushEvent("makefriend")
                    playedfriendsfx = true
                end
                giver.components.leader:AddFollower(v)

                maxSpiders = maxSpiders - 1

                 if v.components.sleeper:IsAsleep() then
                      v.components.sleeper:WakeUp()
                end

            end
            maxSpiders = maxSpiders - 1

            if v.components.sleeper:IsAsleep() then
                v.components.sleeper:WakeUp()
            end

        end
    end
end

 

  • Like 2
  • Potato Cup 1

Share this comment


Link to comment
Share on other sites



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...