local function fixBikeFriction(p)
	if not (p and p.valid) then return end
	if not (p.mo and p.mo.valid) then return end
	if not (p.mo.skin == "shadow") then return end
	if not (p.shadow and p.sbike) then return end
	
	local m = p.mo
	local s = p.shadow
	local b = p.sbike
	local grounded = P_IsObjectOnGround(m)
	
	if grounded then
		local driftmod = b.drift and FRACUNIT/2 or FRACUNIT
		local additive = FixedMul((FRACUNIT - m.friction)/4*3, driftmod)
		m.friction = max(0, min(FRACUNIT, $+additive))
	end
end

addHook("PlayerThink", fixBikeFriction)