-- This Source Code Form is subject to the terms of the bCDDL, v. 1.1.
-- If a copy of the bCDDL was not distributed with this
-- file, You can obtain one at http://beamng.com/bCDDL-1.1.txt

local M = {}
local timer = 0

local function updateRI()
end

local function updateGFX(dt)
    if electrics.values.hoodLatchCoupler_notAttached == 1 then
        timer = timer + dt
        if timer >= 0 then
            electrics.values.hood_releaser = 1
        end
        if timer >= 0.5 then
            electrics.values.hood_releaser = 0
        end	
    else
        electrics.values.hood_releaser = updateRI()
        timer = 0

        if electrics.values.updateRI == 1 then
            electrics.values.hood_releaser = 1
        elseif electrics.values.updateRI ~= 0 then
            electrics.values.hood_releaser = 0
        end
    end
end


M.updateGFX = updateGFX
M.updateRI = updateRI

return M
