The issue stems from the insulation and cooling benefits not being disabled on being unequipped, and/or not checking if the owner is moving after being equipped. Normally, only durability consumption is disabled on being unequipped.
A simple solution would be to modify the _onlocomote function to account for not having an owner, or an owner without a locomotor component, and let it fall back to the "not moving" behavior. Then, calling this function on equipping it (and passing the owner), and calling it without passing an owner when unequipping or if it's equipped on a model.
Something like this:
local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_minifan", "swap_minifan") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") if inst._wheel ~= nil then inst._wheel:Remove() end inst._wheel = SpawnPrefab("fan_wheel") inst._wheel.entity:SetParent(owner.entity) inst._wheel:ListenForEvent("onremove", onremove, inst) if inst._owner ~= nil then inst:RemoveEventCallback("locomote", inst._onlocomote, inst._owner) end inst._owner = owner inst:ListenForEvent("locomote", inst._onlocomote, owner) inst._onlocomote(owner) -- check owner locomotion state right away end local function onunequip(inst, owner) if inst._wheel ~= nil then inst._wheel:StartUnequipping(inst) inst._wheel = nil end if inst._owner ~= nil then inst:RemoveEventCallback("locomote", inst._onlocomote, inst._owner) inst._owner = nil end -- checked with _onlocomote --if inst.components.fueled ~= nil then -- inst.components.fueled:StopConsuming() --end owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") inst._onlocomote(nil) -- stop consuming end local function onequiptomodel(inst, owner, from_ground) -- checked with _onlocomote --if inst.components.fueled ~= nil then -- inst.components.fueled:StopConsuming() --end inst._onlocomote(nil) -- stop consuming end -- given that the functions above check for inst.components.fueled ~= nil, this could be added below too inst._onlocomote = function(owner) -- if owner.components.locomotor.wantstomoveforward then if owner ~= nil and owner.components.locomotor ~= nil and owner.components.locomotor.wantstomoveforward then if not inst.components.fueled.consuming then inst.components.fueled:StartConsuming() inst.components.insulator:SetInsulation(TUNING.INSULATION_SMALL) inst.components.heater:SetThermics(false, true) inst._wheel:SetSpinning(true) end elseif inst.components.fueled.consuming then inst.components.fueled:StopConsuming() inst.components.insulator:SetInsulation(0) inst.components.heater:SetThermics(false, false) inst._wheel:SetSpinning(false) end end
Steps to Reproduce
- Equip the whirly fan.
- Move and then unequip it.
- Stand still.
- Equip the same whirly fan again and don't move.
- Notice how its benefits still apply until you move and stop again.
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 accountSign in
Already have an account? Sign in here.
Sign In Now