Minor speedups to movement: First Blood Part 2

This commit is contained in:
vuonojenmustaturska
2017-11-14 15:00:45 -06:00
committed by CitadelStationBot
parent 9c7da6a133
commit 8136148303
27 changed files with 48 additions and 63 deletions
+9 -14
View File
@@ -1,8 +1,8 @@
/mob/CanPass(atom/movable/mover, turf/target)
if((mover.pass_flags & PASSMOB))
return TRUE
if(istype(mover, /obj/item/projectile) || mover.throwing)
return (!density || lying)
if(mover.checkpass(PASSMOB))
return TRUE
if(buckled == mover)
return TRUE
if(ismob(mover))
@@ -112,6 +112,7 @@
#define MOVEMENT_DELAY_BUFFER 0.75
#define MOVEMENT_DELAY_BUFFER_DELTA 1.25
/client/Move(n, direct)
if(world.time < move_delay)
return FALSE
@@ -129,15 +130,13 @@
if(mob.stat == DEAD)
mob.ghostize()
return FALSE
if(moving)
return FALSE
if(mob.force_moving)
return FALSE
if(isliving(mob))
var/mob/living/L = mob
if(L.incorporeal_move) //Move though walls
Process_Incorpmove(direct)
return FALSE
var/mob/living/L = mob //Already checked for isliving earlier
if(L.incorporeal_move) //Move though walls
Process_Incorpmove(direct)
return FALSE
if(mob.remote_control) //we're controlling something, our movement is relayed to it
return mob.remote_control.relaymove(mob, direct)
@@ -162,7 +161,6 @@
return FALSE
//We are now going to move
moving = 1
var/delay = mob.movement_delay()
if (old_move_delay + (delay*MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time)
move_delay = old_move_delay + delay
@@ -181,8 +179,7 @@
else
. = ..()
moving = 0
if(mob && .)
if(.) // If mob is null here, we deserve the runtime
if(mob.throwing)
mob.throwing.finalize(FALSE)
@@ -190,8 +187,6 @@
for(var/obj/O in mob.user_movement_hooks)
O.intercept_user_move(direct, mob, n, oldloc)
return .
/mob/Moved(oldLoc, dir, Forced = FALSE)
. = ..()
for(var/obj/O in contents)