ID:269048
 
Hres my code for running, but there are some glitches i cannot figure out. Can somone help?

    Northwest()
if(usr.running == 0)
mob.Running()
else
mob.Walking()

Running()//This is the proc that enables the usr to run!!!
if(usr.running == 0)
usr.running = 1
Walking()
if(usr.running == 1)
usr.running = 0

client
North()
if(mob.InventoryUp)
for(var/obj/HUD/AU/A in usr.client.screen)
A.Click()
else
if(usr.move)
..()
else
return
if(mob.running)
..()
return ..()
else
if(usr.move)
return

South()
if(mob.InventoryUp)
for(var/obj/HUD/AD/A in usr.client.screen)
A.Click()
else
if(usr.move)
..()
else
return ..()
if(mob.running)
..()
return ..()
else
return ..()
East()
if(mob.running)
..()
return ..()
else
if(usr.move)
return ..()

West()
if(mob.running)
..()
return ..()
else
if(usr.move)
return ..()


Some Glitches I found were when the running is turned off, the south movement runs, then walks. Also, the East and west keys , when running, they run, then move a third space. Can someone help me/
    South()
if(mob.InventoryUp)
for(var/obj/HUD/AD/A in usr.client.screen)
A.Click()
else
if(usr.move)
..()
else
return ..()
if(mob.running)
..()
return ..()
else
return ..()


This is overly complicated it seems. But your walking problem, (and possibly your other problems) stem from having your first if statment backwards.

Say mob.InventoryUp is false...we move to if(usr.move) which is true, so we call ..(), which moves the character 1 space south. Then, we go to if(mob.running) which is false, so we go to else/return ..(), which moves the character 1 space south again, thus running.

Try something simple like
South()
if(mob.InventoryUp)
for(var/obj/HUD/AD/A in usr.client.screen)
A.Click()
else
if(mob.move)
return ..()
..()
return ..()


I'm not exactly sure this is what you want, but it's a place to start cleaning.