-- Clear jam mid animation with motion marks
---@param state number
---@param mark string
---@param hud_item game_object
---@param owner game_object
function actor_on_hud_animation_mark(state, mark, hud_item, owner)
	if mark == "clear_jam" then
		if not hud_item or not owner then return end

		local wpn = hud_item:cast_Weapon()
		if not wpn then return end

		if owner:id() ~= AC_ID then return end

		wpn:SetMisfire(false)
	end
end

function on_game_start()
	RegisterScriptCallback("actor_on_hud_animation_mark",actor_on_hud_animation_mark)
end