if not _G.g_foldingDetachLimitFixEnabled then
	_G.g_foldingDetachLimitFixEnabled = true

	function Foldable:isDetachAllowed(superFunc)
		local spec = self.spec_foldable

		if spec.detachingMaxLimit < spec.foldAnimTime or spec.foldAnimTime < spec.detachingMinLimit then
			return false, spec.unfoldWarning
		end

		if not spec.allowDetachingWhileFolding and (spec.foldMiddleAnimTime == nil or math.abs(spec.foldAnimTime - spec.foldMiddleAnimTime) > 0.001) and spec.foldAnimTime > 0 and spec.foldAnimTime < 1 then
			return false, spec.unfoldWarning
		end

		return superFunc(self)
	end
end
