So I'm playing around with forum_account's sidescroller library and I'm using his spikes tiles code from the game-demo section. Below is a gif (terrible quality using gyazo) of what my problem is. Once i step onto the spikes my character sort of slides along of the floor and doesn't lock up the controls.
http://gyazo.com/80e82b47fa1e1f022c3e52a30e8d4255
Code:
//spikes code
turf
spikes
icon_state = "spikes"
New()
..()
var/obj/o = new /obj()
o.icon_state = "spikes-overlay"
o.layer = MOB_LAYER + 1
overlays += o
stepped_on(mob/m)
var/turf/t = locate(x,y+1,z)
if(istype(t,/turf/spikes))
m.die()
//die code
die()
if(dead) return
dead = 1
if(client)
src << "Ouch! You died!"
client.clear_input()
client.lock_input()
spawn(10)
loc = locate(2,5,1)
dead = 0
client.unlock_input()
// make enemies (mobs without clients) get deleted
else
spawn(20)
del src
This is his die() proc I mentioned.