Now gliding_size for pulled objects and mobs is also changed.

This commit is contained in:
Kreastr
2012-11-07 13:13:45 +02:00
parent 484351a200
commit 2e8b305ac3
+21 -12
View File
@@ -291,20 +291,20 @@
if("walk")
mdelay += 7+config.walk_speed
if(config.Tickcomp)
mdelay -= 1.3
var/tickcomp = ((1/(world.tick_lag))*1.3)
mdelay += tickcomp
move_delay += mdelay
if (mdelay != mob.lastmovementdelay)
mob.lastmovementdelay = mdelay
mob.glide_size = 40*(world.tick_lag)/mob.lastmovementdelay
src << "Debug: Your new glide speed is [mob.glide_size]"
if(config.Tickcomp)
move_delay -= 1.3
var/tickcomp = ((1/(world.tick_lag))*1.3)
move_delay = move_delay + tickcomp
mob.UpdateGlide(mdelay)
if (mob.pulling)
if (istype(mob.pulling,/mob))
var/mob/M = mob.pulling
M.UpdateGlide(mdelay)
else
mob.pulling.glide_size = mob.glide_size
//We are now going to move
moving = 1
@@ -326,6 +326,7 @@
else
diag = null
if ((get_dist(mob, M) > 1 || diag))
M.UpdateGlide(mdelay)
step(M, get_dir(M.loc, T))
else
for(var/mob/M in L)
@@ -334,6 +335,7 @@
M.animate_movement = 3
for(var/mob/M in L)
spawn( 0 )
M.UpdateGlide(mdelay)
step(M, direct)
return
spawn( 1 )
@@ -512,3 +514,10 @@
prob_slip = round(prob_slip)
return(prob_slip)
//Updates Glide_size of mob according to its speed.
/mob/proc/UpdateGlide(var/mdelay = 2)
if (mdelay != lastmovementdelay)
lastmovementdelay = mdelay
glide_size = 32*(world.tick_lag)/lastmovementdelay
src << "Debug: Your new glide speed is [glide_size]"