Fixes Pun Pun causing runtimes by knocking on windows.

This commit is contained in:
NonQueueingMatt
2020-01-07 15:00:16 +01:00
parent dc48c1e056
commit d70c6824b7
2 changed files with 48 additions and 8 deletions
+7 -8
View File
@@ -168,7 +168,7 @@
step(src, get_dir(AM, src))
take_damage(tforce)
/obj/structure/window/attack_hand(mob/user as mob)
/obj/structure/window/attack_hand(var/mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(HULK in user.mutations)
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
@@ -176,23 +176,22 @@
user.do_attack_animation(src)
shatter()
else if (usr.a_intent == I_HURT)
if (istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/H = usr
else if (user.a_intent == I_HURT)
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.species.can_shred(H) || (H.is_berserk()))
attack_generic(H,25)
return
playsound(src.loc, 'sound/effects/glassknock.ogg', 90, 1)
user.do_attack_animation(src)
usr.visible_message("<span class='danger'>\The [usr] bangs against \the [src]!</span>",
user.visible_message("<span class='danger'>\The [user] bangs against \the [src]!</span>",
"<span class='danger'>You bang against \the [src]!</span>",
"You hear a banging sound.")
else
playsound(src.loc, 'sound/effects/glassknock.ogg', 60, 1)
usr.visible_message("[usr.name] knocks on the [src.name].",
"You knock on the [src.name].",
user.visible_message("[user] knocks on \the [src.name].",
"You knock on \the [src.name].",
"You hear a knocking sound.")
return