Merge pull request #3945 from Citadel-Station-13/upstream-merge-32702
[MIRROR] Minor speedups to movement: First Blood Part 2
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
/////////
|
||||
var/datum/preferences/prefs = null
|
||||
var/move_delay = 1
|
||||
var/moving = null
|
||||
|
||||
var/area = null
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
density = TRUE
|
||||
|
||||
/obj/structure/bonfire/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
if(istype(mover) && (mover.pass_flags & PASSTABLE))
|
||||
return TRUE
|
||||
if(mover.throwing)
|
||||
return TRUE
|
||||
|
||||
@@ -56,8 +56,6 @@
|
||||
nutrition -= HUNGER_FACTOR/10
|
||||
if(m_intent == MOVE_INTENT_RUN)
|
||||
nutrition -= HUNGER_FACTOR/10
|
||||
if((disabilities & FAT) && m_intent == MOVE_INTENT_RUN && bodytemperature <= 360)
|
||||
bodytemperature += 2
|
||||
|
||||
/mob/living/carbon/Moved(oldLoc, Dir)
|
||||
. = ..()
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
FP.update_icon()
|
||||
update_inv_shoes()
|
||||
//End bloody footprints
|
||||
|
||||
S.step_action()
|
||||
|
||||
/mob/living/carbon/human/Moved()
|
||||
. = ..()
|
||||
if(buckled_mobs && buckled_mobs.len && riding_datum)
|
||||
|
||||
@@ -471,7 +471,6 @@
|
||||
s_active.close(src)
|
||||
|
||||
if(lying && !buckled && prob(getBruteLoss()*200/maxHealth))
|
||||
|
||||
makeTrail(newloc, T, old_direction)
|
||||
|
||||
/mob/living/movement_delay(ignorewalk = 0)
|
||||
|
||||
@@ -395,7 +395,6 @@
|
||||
pulling = null
|
||||
grab_state = 0
|
||||
update_pull_hud_icon()
|
||||
|
||||
if(isliving(ex_pulled))
|
||||
var/mob/living/L = ex_pulled
|
||||
L.update_canmove()// mob gets up if it was lyng down in a chokehold
|
||||
@@ -676,8 +675,6 @@
|
||||
/mob/proc/canface()
|
||||
if(!canmove)
|
||||
return 0
|
||||
if(client.moving)
|
||||
return 0
|
||||
if(world.time < client.move_delay)
|
||||
return 0
|
||||
if(stat==2)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -405,7 +405,7 @@
|
||||
|
||||
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
|
||||
..()
|
||||
if(isliving(AM) && (AM.density || AM == original) && !checkpass(PASSMOB))
|
||||
if(isliving(AM) && (AM.density || AM == original) && !(src.pass_flags & PASSMOB))
|
||||
Collide(AM)
|
||||
|
||||
/obj/item/projectile/Destroy()
|
||||
|
||||
Reference in New Issue
Block a user