Struggle var mob/player one = null two = null
proc Break(var/mob/player/winner,var/mob/player/loser,var/distance) step(winner, turn(winner.dir,180) ) winner.endStruggle() loser.endStruggle() loser.knock_back(winner,0+distance,5)
push(var/mob/player/m) if(m == one) var/turf/t = get_step(get_step(m, m.dir), m.dir) if(t) if(!t.density) for(var/mob/player/o in t) Break(m, two) o.knock_back(m, 1, 5) return
for(var/obj/dense_object/d in t) Break(m,two) return
flick("push_struggle",one) flick("pushed_struggle",two) step(two, m.dir) step(m, m.dir) else Break(m,two)
else world << output("BREAK","output2") Break(m,two)
else var/turf/t = get_step(get_step(m,m.dir),m.dir) if(t) if(!t.density) for(var/mob/player/o in t) Break(m, one) o.knock_back(m, 1, 5) return for(var/obj/dense_object/d in t) Break(m, one) return
flick("pushed_struggle",one) flick("push_struggle",two) step(one, m.dir) step(m, m.dir) else Break(m, one) else Break(m, one)
|
I don't see how using spawn will remove a problem with infinite recursion. That's usually an issue with logic, which spawning wouldn't prevent.
Anyways, I don't see why this is in Design Philosophy and not somewhere else, like Code Problems.
And it would help if you explained what you were trying to accomplish. Like, instead of posting code, just explain what the push proc does.
I don't think people want to examine your code to figure out what it does. It's much faster if you just tell us.
I don't even know what you mean by "sword struggle." And what is moving (Move proc) even supposed to mean in that case?