Sign in to follow this  
Thrance

Rabbit Hutches bug in interiors

Recommended Posts

Thrance    0

Hello, I encountered a bug while playing with the Hamlet DLC: rabbit hutches are broken in interiors. Bunnymen would spawn once if you are in the same room as the hutch or disappear forever in limbo.

 Being a modder myself, I made the following fix to the rabbithouse.lua file:

Replace:

local function Empty(inst)
    --print(inst, "OnDay")
    if not inst:HasTag("burnt") then
        if inst.components.spawner:IsOccupied() then
            if inst.doortask then
                inst.doortask:Cancel()
                inst.doortask = nil
            end
            inst.doortask = inst:DoTaskInTime(1 + math.random()*2, function() inst.components.spawner:ReleaseChild() end)
        end
    end
end

By:

local function Empty(inst)
    if inst:HasTag("burnt") or GetClock():IsDay() then
        inst.doortask = nil
    else
        if inst.doortask and not inst:IsInLimbo() then
            if inst.components.spawner:IsOccupied() then
                inst.components.spawner:ReleaseChild()
            end
            inst.doortask = nil
        else
            inst.doortask = true
            inst:DoTaskInTime(1 + math.random()*2, function() Empty(inst) end)
        end
    end
end

Adding those checks fixed the bug. I guess pig/wildbore houses have the same problem and need fixing too.

Thank you for the great game.

Share this post


Link to post
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

Sign in to follow this