Relaymove tweaks (#19489)

Made relaymoves uniform in function header and non sleepable.
Improved IPC/borg recharger, made it time constant.
Tweaked client/Move() to avoid a range(), moved a relaymove around to
fix a bug, some minor tweaks.
Fixed IPC/borg recharge station not taking the IPC/Borg in on bump.
This commit is contained in:
Fluffy
2024-06-22 15:13:29 +00:00
committed by GitHub
parent 36793514d6
commit 67030cf90e
37 changed files with 316 additions and 99 deletions
+5 -1
View File
@@ -201,7 +201,11 @@
if("Vaurca")
braintype = "vaurca"
/obj/item/device/mmi/relaymove(var/mob/user, var/direction)
/obj/item/device/mmi/relaymove(mob/living/user, direction)
. = ..()
if(!.)
return
if(user.stat || user.stunned)
return
var/obj/item/rig/rig = get_rig()
+5 -1
View File
@@ -76,7 +76,11 @@
src.help_up_offer = 0
/mob/living/carbon/relaymove(var/mob/living/user, direction)
/mob/living/carbon/relaymove(mob/living/user, direction)
. = ..()
if(!.)
return
if((user in contents) && istype(user))
if(user.last_special <= world.time)
user.last_special = world.time + 50
+17 -15
View File
@@ -242,8 +242,10 @@
var/old_move_delay = move_delay
if(!mob)
return // Moved here to avoid nullrefs below
if(!direct || !new_loc)
return FALSE
if(!mob?.loc)
return FALSE
if(mob.control_object)
Move_object(direct)
@@ -307,6 +309,10 @@
if(!mob.lastarea)
mob.lastarea = get_area(mob.loc)
if(isobj(mob.loc) || ismob(mob.loc)) //Inside an object, tell it we are moving out
var/atom/O = mob.loc
return O.relaymove(mob, direct)
if(isturf(mob.loc))
if(!mob.check_solid_ground())
var/allowmove = mob.Allow_Spacemove(0)
@@ -319,15 +325,15 @@
if(mob.restrained()) //Why being pulled while cuffed prevents you from moving
for(var/mob/M in range(mob, 1))
if(M.pulling == mob)
if(!M.restrained() && M.stat == 0 && M.canmove && mob.Adjacent(M))
to_chat(src, SPAN_NOTICE("You're restrained! You can't move!"))
return FALSE
else
M.stop_pulling()
var/mob/puller = mob.pulledby
if(puller)
if(!puller.restrained() && puller.stat == 0 && puller.canmove && mob.Adjacent(puller))
to_chat(src, SPAN_NOTICE("You're restrained! You can't move!"))
return FALSE
else
puller.stop_pulling()
if(mob.pinned.len)
if(length(mob.pinned))
to_chat(src, SPAN_WARNING("You're pinned to a wall by [mob.pinned[1]]!"))
move_delay = world.time + 1 SECOND // prevent spam
return FALSE
@@ -423,7 +429,7 @@
else
. = mob.SelfMove(new_loc, direct)
for (var/obj/item/grab/G in list(mob:l_hand, mob:r_hand))
for (var/obj/item/grab/G in list(mob.l_hand, mob.r_hand))
if (G.state == GRAB_NECK)
mob.set_dir(GLOB.reverse_dir[direct])
G.adjust_position()
@@ -437,10 +443,6 @@
var/mob/living/carbon/human/H = mob
H.species.handle_sprint_cost(H, sprint_tally, FALSE)
if(isobj(mob.loc) || ismob(mob.loc)) //Inside an object, tell it we moved
var/atom/O = mob.loc
return O.relaymove(mob, direct)
/mob/living/carbon/human/proc/get_crawl_tally()
var/obj/item/organ/external/rhand = organs_by_name[BP_R_HAND]
. += limb_check(rhand)