Jump to content

Campfire is not destroyable


KXWl1
  • DLC VERSION - IMPORTANT!: Vanilla - NO DLC, Reign of Giants, Shipwrecked, Hamlet Pending

This is a bug as it is intentional many times in Hamlet's code (but I hope to make it destroyable in vanilla and other dlcs too):

prefab files "ancient_hulk" function (applydamagetoent) :

local function applydamagetoent(inst,ent, targets, rad, hit)
     ......
        local range = rad + vradius
        if hit or v:GetDistanceSqToPoint(Vector3(x, y, z)) < range * range then
            local isworkable = false
            if v.components.workable ~= nil then
                local work_action = v.components.workable:GetWorkAction()
                --V2C: nil action for campfires
                isworkable =
                    (   work_action == nil and v:HasTag("campfire")    ) or
                    
                        (   work_action == ACTIONS.CHOP or
                            work_action == ACTIONS.HAMMER or
                            work_action == ACTIONS.MINE or   
                            work_action == ACTIONS.DIG or
                            work_action == ACTIONS.BLANK
                        )
    ......
    return targets   
end

function "OnCollide":

local function OnCollide(inst, other)
    local v = other

    local isworkable = false
    if v.components.workable ~= nil then
        local work_action = v.components.workable:GetWorkAction()
        --V2C: nil action for campfires
        isworkable =
            (   work_action == nil and v:HasTag("campfire")    ) or
            
                (   work_action == ACTIONS.CHOP or
                    work_action == ACTIONS.HAMMER or
                    work_action == ACTIONS.MINE or   
                    work_action == ACTIONS.DIG
                )
    end    
     ......
    -- may want to do some charging damage?
end

prefab files "laser": 

local function DoDamage(inst, targets, skiptoss)
  ......
                     local work_action = v.components.workable:GetWorkAction()
                    --V2C: nil action for campfires
                    isworkable =
                        (   work_action == nil and v:HasTag("campfire")    ) or
                        
                            (   work_action == ACTIONS.CHOP or
                                work_action == ACTIONS.HAMMER or
                                work_action == ACTIONS.MINE or   
                                work_action == ACTIONS.DIG
                            ) 
  .....
end

And in so many others's code......

Adding workable component to campfire and making it nil action will be good.


Steps to Reproduce

1. Build a campfire.

2. Add fuel to max level.

3. minotaur and ancient_hulk cannot destroy it with Collision, neither ancient_herald's attack does.

  • Like 1



User Feedback


There are no comments to display.



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