From a5f06430e4429478fbba425616c46d39cbd01fd2 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sat, 15 Feb 2020 23:36:50 -0700 Subject: [PATCH] repulse armor sanity (#10949) --- .../modules/clothing/suits/reactive_armour.dm | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/code/modules/clothing/suits/reactive_armour.dm b/code/modules/clothing/suits/reactive_armour.dm index 0d2f68f580..dff62dd2c3 100644 --- a/code/modules/clothing/suits/reactive_armour.dm +++ b/code/modules/clothing/suits/reactive_armour.dm @@ -215,14 +215,24 @@ playsound(get_turf(owner),'sound/magic/repulse.ogg', 100, 1) owner.visible_message("[src] blocks [attack_text], converting the attack into a wave of force!") var/turf/T = get_turf(owner) - var/list/thrown_items = list() - for(var/atom/movable/A in range(T, 7)) - if(A == owner || A.anchored || thrown_items[A]) + var/list/cachedrange = range(T, 7) - owner + var/safety = 50 + var/list/to_throw = list() + for(var/mob/living/L in cachedrange) + if(L.move_resist > MOVE_FORCE_EXTREMELY_STRONG) continue - var/throwtarget = get_edge_target_turf(T, get_dir(T, get_step_away(A, T))) - A.throw_at(throwtarget,10,1) - thrown_items[A] = A - + to_throw += L + for(var/obj/O in cachedrange) + if(O.anchored) + continue + to_throw += O + for(var/i in to_throw) + if(!safety) + break + var/atom/movable/AM = i + var/throwtarget = get_edge_target_turf(T, get_dir(T, get_step_away(AM, T))) + AM.throw_at(throwtarget,10,1) + safety-- reactivearmor_cooldown = world.time + reactivearmor_cooldown_duration return 1