Prevents shoving people into the locker dimension (Fixes other shove things too) (#63372)

Made this like half a month ago. Fixes #63095
Fixes #63096, all of it

People seem to be upset by being force moved into an open locker, can't imagine why. Let's start with this
I'll be back for the rest soon (I HAVE RETURNED)
This commit is contained in:
LemonInTheDark
2021-12-17 12:06:06 +00:00
committed by GitHub
parent 0521519867
commit 5bca18b575
3 changed files with 12 additions and 7 deletions
@@ -694,11 +694,13 @@
return
if(!opened && !shove_blocked)
return
if(opened)
var/was_opened = opened
if(!toggle())
return
if(was_opened)
target.forceMove(src)
else
target.Knockdown(SHOVE_KNOCKDOWN_SOLID)
toggle()
update_icon()
target.visible_message(span_danger("[shover.name] shoves [target.name] into \the [src]!"),
span_userdanger("You're shoved into \the [src] by [target.name]!"), span_hear("You hear aggressive shuffling followed by a loud thud!"), COMBAT_MESSAGE_RANGE, src)
+1 -1
View File
@@ -1307,7 +1307,7 @@
/mob/living/carbon/proc/disarm_collision(datum/source, mob/living/carbon/shover, mob/living/carbon/target, shove_blocked)
SIGNAL_HANDLER
if(src == target || !can_be_shoved_into)
if(src == target || LAZYFIND(target.buckled_mobs, src) || !can_be_shoved_into)
return
target.Knockdown(SHOVE_KNOCKDOWN_HUMAN)
if(!is_shove_knockdown_blocked())
@@ -276,9 +276,9 @@
var/directional_blocked = FALSE
var/can_hit_something = (!target.is_shove_knockdown_blocked() && !target.buckled)
if(shove_blocked && can_hit_something)
if(!(shove_dir in GLOB.cardinals)) //Directional checks to make sure that we're not shoving through a windoor or something like that
return
//Directional checks to make sure that we're not shoving through a windoor or something like that
if(shove_blocked && can_hit_something && (shove_dir in GLOB.cardinals))
var/target_turf = get_turf(target)
for(var/obj/obj_content in target_turf)
if(obj_content.flags_1 & ON_BORDER_1 && obj_content.dir == shove_dir && obj_content.density)
@@ -291,7 +291,10 @@
break
if(can_hit_something)
if(directional_blocked || (!(SEND_SIGNAL(target_shove_turf, COMSIG_CARBON_DISARM_COLLIDE, src, target, shove_blocked) & COMSIG_CARBON_SHOVE_HANDLED) && shove_blocked))
//Don't hit people through windows, ok?
if(!directional_blocked && SEND_SIGNAL(target_shove_turf, COMSIG_CARBON_DISARM_COLLIDE, src, target, shove_blocked) & COMSIG_CARBON_SHOVE_HANDLED)
return
if(directional_blocked || shove_blocked)
target.Knockdown(SHOVE_KNOCKDOWN_SOLID)
target.visible_message(span_danger("[name] shoves [target.name], knocking [target.p_them()] down!"),
span_userdanger("You're knocked down from a shove by [name]!"), span_hear("You hear aggressive shuffling followed by a loud thud!"), COMBAT_MESSAGE_RANGE, src)