diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 0d3d3111056..3bcfe436c35 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -261,7 +261,7 @@ /obj/machinery/door/window/attack_animal(mob/living/simple_animal/M) . = ..() - if(M.environment_smash >= ENVIRONMENT_SMASH_WALLS) + if(. && M.environment_smash >= ENVIRONMENT_SMASH_WALLS) playsound(src, 'sound/effects/grillehit.ogg', 80, TRUE) deconstruct(FALSE) M.visible_message("[M] smashes through [src]!", "You smash through [src].") diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 06096a47820..6effd6dd37e 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -79,15 +79,17 @@ shockcooldown = world.time + my_shockcooldown /obj/structure/grille/attack_animal(mob/living/simple_animal/user) - if(QDELETED(src) || shock(user, 70)) + . = ..() + if(!. || QDELETED(src) || shock(user, 70)) return + if(user.environment_smash >= ENVIRONMENT_SMASH_STRUCTURES) playsound(src, 'sound/effects/grillehit.ogg', 80, TRUE) obj_break() user.visible_message("[user] smashes through [src]!", "You smash through [src].") - else - take_damage(rand(5, 10), BRUTE, MELEE, 1) - return ..() + return + + take_damage(rand(5,10), BRUTE, MELEE, 1) /obj/structure/grille/hulk_damage() return 60 diff --git a/code/game/objects/structures/railings.dm b/code/game/objects/structures/railings.dm index 2d93cf9b154..c03921db25a 100644 --- a/code/game/objects/structures/railings.dm +++ b/code/game/objects/structures/railings.dm @@ -23,7 +23,7 @@ /obj/structure/railing/attack_animal(mob/living/simple_animal/M) . = ..() - if(M.environment_smash >= ENVIRONMENT_SMASH_WALLS) + if(. && M.environment_smash >= ENVIRONMENT_SMASH_WALLS) deconstruct(FALSE) M.visible_message("[M] tears apart [src]!", "You tear apart [src]!") diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index cd742fffd70..32d85501b86 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -241,7 +241,7 @@ /obj/structure/table/attack_animal(mob/living/simple_animal/M) . = ..() - if(M.environment_smash >= minimum_env_smash) + if(. && M.environment_smash >= minimum_env_smash) deconstruct(FALSE) M.visible_message("[M] smashes [src]!", "You smash [src].") diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index dbe21cb4c29..38d06228570 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -171,19 +171,14 @@ /obj/structure/window/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1) //used by attack_alien, attack_animal, and attack_slime if(!can_be_reached(user)) return - ..() - + return ..() /obj/structure/window/attack_animal(mob/living/simple_animal/M) if(!can_be_reached(M)) return . = ..() - if(M.environment_smash >= env_smash_level) + if(. && M.environment_smash >= env_smash_level) deconstruct(FALSE) M.visible_message("[M] smashes through [src]!", "You smash through [src].", "You hear glass breaking.") - else - to_chat(M, "You smash against the window.") - take_damage(rand(25, 75)) - /obj/structure/window/attackby(obj/item/I, mob/living/user, params) if(!can_be_reached(user))