Jump to content

farm_plants picking crashes due to LuckFormulas.FruitFlyOnPickedWeed being nil


Leonardo Cox
  • Pending

line 295 in farm_plants.lua

local function OnPicked(inst, doer)
    local x, y, z = inst.Transform:GetWorldPosition()
    if TheWorld.Map:GetTileAtPoint(x, y, z) == WORLD_TILES.FARMING_SOIL then
        local soil = SpawnPrefab("farm_soil")
        soil.Transform:SetPosition(x, y, z)
        soil:PushEvent("breaksoil")
    end

    if not inst.is_oversized and inst:HasTag("farm_plant_killjoy") and TryLuckRoll(doer, TUNING.FARMPLANT_SPAWN_FRUITFLY_ON_WEED_CHANCE, LuckFormulas.FruitFlyOnPickedWeed) then
        local fruitfly = SpawnPrefab("fruitfly")
        fruitfly.Transform:SetPosition(x, y, z)
    end

    call_for_reinforcements(inst, doer)
end

TryLuckRoll call tries to call LuckFormulas.FruitFlyOnPickedWeedFruit which returns nil, as a result this causes a crash whenever fruitfly is supposed to spawn after picking a farm plant.

Might want to double check all other calls to LuckFormulas to ensure they're defined.


Steps to Reproduce

Pick a rotted farm plant and crash.




User Feedback


1 hour ago, Shoebox said:

I am experiencing this as well. Thanks for tracking it down. I've attached the relevant portion of my server log just in case it helps narrow down the root (heh) cause.

master_server_log.txt 5.06 kB · 0 downloads

Might want to check it now because they released a patch for DST that seems to have defined LuckFormulas.FruitFlyOnPickedWeed.

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