local mod = get_mod("FPS_FIX")
local frame_rate = require("scripts/managers/frame_rate/frame_rate_manager")

mod:hook(CLASS.FrameRateManager, "_set_target_fps", function(func, self, is_throttled)
	local target_fps
	if not Application.rendering_enabled() then
		target_fps = GameParameters.tick_rate
	elseif is_throttled then
		target_fps = 0
	else
		target_fps = 0
		if not Application.render_caps("reflex_supported") then
			target_fps = Application.render_config("settings", "nv_framerate_cap")
		end
	end
	Application.set_time_step_policy("throttle", target_fps)
end)