get_step() not working with pixel movement? in Developer Help
|
|
Code:
AttackStab() set hidden = 1 if(roundIs=="Ring Around The Zodiac"&&canFight==0||usr.style=="Spectating"||usr.stabSpam) return if(usr.insane==1||roundIs=="Psycho Hunt"||roundIs=="Ring Around The Zodiac"||roundIs=="The Mystery Zodiac") for(var/mob/M in get_step(usr,usr.dir)) if(usr.insane==0&&M.insane==0&&roundIs!="Ring Around The Zodiac") usr<<"Can't hurt someone who isn't insane!" return if(M.style=="Spectating") return usr.stabSpam=1 M.Health-=1 if(usr.wepselect==1) flick("Attack",usr) view(usr)<<"<font color = green>[usr] stabbed [M] with a knife!" if(usr.wepselect==2) view(usr)<<"<font color = green>[usr] hits [M] with a [usr.secondWeapon]!" M.Death(usr) spawn(10) usr.stabSpam=0
|
Problem description:
It works if I'm a distance away from the person, but if I'm up on them it doesn't recognize them so I can't stab them. Anyone know a workaround to get this right? I've also had problems where I've stabbed myself. I've done a test with the following:
Check() for(var/mob/M in get_step(usr,usr.dir)) world<<"[M]"
|
And here's what I get (video: ignore the poor pixel movement, was trying to fix it):
http://screencast.com/t/gOn7UuhMef
|