From e12a1a4de4ae5d0e1945fe07ff68608aa2f1e35e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A1=D0=B8=D1=80=D0=BE=D1=82=D0=BA=D0=B0?=
<114731039+ErdGinalD@users.noreply.github.com>
Date: Fri, 22 Sep 2023 06:17:08 +0300
Subject: [PATCH] bugfix: Drasks now correctly crash any non-admin types of
obstacles (#3560)
---
code/game/machinery/deployable.dm | 10 ++++++++++
code/game/machinery/doors/airlock.dm | 2 +-
code/game/machinery/doors/airlock_types.dm | 10 ++++++++++
code/game/machinery/doors/firedoor.dm | 2 +-
code/game/machinery/doors/windowdoor.dm | 2 +-
code/game/objects/structures/door_assembly.dm | 2 +-
code/game/objects/structures/grille.dm | 2 +-
code/game/objects/structures/windoor_assembly.dm | 2 +-
code/game/objects/structures/window.dm | 2 +-
9 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 457d4ed0e9c..32cd14b900c 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -63,6 +63,16 @@
else
return !density
+/obj/structure/barricade/attack_hand(mob/user)
+ if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
+ SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, user)
+ add_fingerprint(user)
+ user.changeNext_move(CLICK_CD_MELEE)
+ attack_generic(user, user.dna.species.obj_damage)
+ return
+ else
+ ..()
+
/////BARRICADE TYPES///////
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 9cdbf0bb6e3..0f55a3bfc7d 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -746,7 +746,7 @@ About the new airlock wires panel:
if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
add_fingerprint(user)
user.changeNext_move(CLICK_CD_MELEE)
- attack_generic(user, user.dna.species.obj_damage, damage_flag = "melee")
+ attack_generic(user, user.dna.species.obj_damage)
return
if(remove_airlock_note(user, FALSE))
add_fingerprint(user)
diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm
index e9ba3b67784..b62d1c13669 100644
--- a/code/game/machinery/doors/airlock_types.dm
+++ b/code/game/machinery/doors/airlock_types.dm
@@ -311,6 +311,11 @@
normal_integrity = 1000
security_level = 6
+/obj/machinery/door/airlock/centcom/attack_hand(mob/user)
+ . = ..()
+ if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
+ return
+
/obj/machinery/door/airlock/centcom/emag_act(mob/user)
to_chat(user, span_notice("The electronic systems in this door are far too advanced for your primitive hacking peripherals."))
return
@@ -841,6 +846,11 @@
glass = TRUE
normal_integrity = 300
+/obj/machinery/door/airlock/syndicate/extmai/glass/attack_hand(mob/user)
+ . = ..()
+ if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
+ return
+
/*
Misc Airlocks
*/
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index caa50319e62..2254e844037 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -91,7 +91,7 @@
if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
add_fingerprint(user)
user.changeNext_move(CLICK_CD_MELEE)
- attack_generic(user, user.dna.species.obj_damage, damage_flag = "melee")
+ attack_generic(user, user.dna.species.obj_damage)
return
if(operating || !density)
return
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 583ef3506e9..17bdd4921d7 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -235,7 +235,7 @@
if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
add_fingerprint(user)
user.changeNext_move(CLICK_CD_MELEE)
- attack_generic(user, user.dna.species.obj_damage, damage_flag = "melee")
+ attack_generic(user, user.dna.species.obj_damage)
return
return try_to_activate_door(user)
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index 99d0d471ffc..50219a188da 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -57,7 +57,7 @@
if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
add_fingerprint(user)
user.changeNext_move(CLICK_CD_MELEE)
- attack_generic(user, user.dna.species.obj_damage, damage_flag = "melee")
+ attack_generic(user, user.dna.species.obj_damage)
return
. = ..()
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index d4f37365093..388e7f9f610 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -117,7 +117,7 @@
user.changeNext_move(CLICK_CD_MELEE)
if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
user.changeNext_move(CLICK_CD_MELEE)
- attack_generic(user, user.dna.species.obj_damage, damage_flag = "melee")
+ attack_generic(user, user.dna.species.obj_damage)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
user.visible_message("[user] hits [src].")
if(!shock(user, 70))
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 7da25f494b2..4a66c4326cd 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -91,7 +91,7 @@
if(user.a_intent == INTENT_HARM && ishuman(user) && user.dna.species.obj_damage)
add_fingerprint(user)
user.changeNext_move(CLICK_CD_MELEE)
- attack_generic(user, user.dna.species.obj_damage, damage_flag = "melee")
+ attack_generic(user, user.dna.species.obj_damage)
return
. = ..()
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 15e931698a7..bea987bb944 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -181,7 +181,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
if(user.a_intent == INTENT_HARM)
user.changeNext_move(CLICK_CD_MELEE)
if(ishuman(user) && user.dna.species.obj_damage)
- attack_generic(user, user.dna.species.obj_damage, damage_flag = "melee")
+ attack_generic(user, user.dna.species.obj_damage)
else
playsound(src, 'sound/effects/glassknock.ogg', 80, 1)
user.visible_message("[user] bangs against [src]!", \