//Off ground animations
addHook("MobjThinker",function(mo)
  if not mapheaderinfo[gamemap].springspin then return end
	if mo and mo.valid
	and not (mo.skin == "msonic")
	and not (mo.skin == "modernsonic")
		if (mo.state == S_PLAY_FALL)
		and ((mo.momz*P_MobjFlip(mo)) > 8)
		and not (mo.eflags & MFE_GOOWATER)
		and not (mo.player.powers[pw_carry])
		and not (mo.player.pflags & PF_SHIELDABILITY)
			mo.state = S_PLAY_SPRING
		end
		
		if ((mo.state == S_PLAY_STND) or (mo.state == S_PLAY_WAIT) or (mo.state == S_PLAY_WALK) or (mo.state == S_PLAY_RUN) or (mo.state == S_PLAY_DASH))
		and not P_IsObjectOnGround(mo)
		and not (mo.player.powers[pw_carry])
		and not (mo.player.secondjump)
		and mo.player.playerstate == PST_LIVE
			if ((mo.momz*P_MobjFlip(mo)) > 8)
			and not (mo.eflags & MFE_GOOWATER)
				mo.state = S_PLAY_SPRING
			elseif ((mo.momz*P_MobjFlip(mo)) < -8)
				mo.state = S_PLAY_FALL
			end
		end
	end
end, MT_PLAYER)