From 2fff41805785a3db75e1085b3eb79642dd808644 Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Tue, 16 Aug 2022 15:00:59 +1000 Subject: [PATCH] Streamlines flora harvest check. --- code/game/objects/structures/flora/flora.dm | 5 +---- code/game/objects/structures/flora/trees.dm | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/code/game/objects/structures/flora/flora.dm b/code/game/objects/structures/flora/flora.dm index eeb178aa93..aafdc194a7 100644 --- a/code/game/objects/structures/flora/flora.dm +++ b/code/game/objects/structures/flora/flora.dm @@ -72,10 +72,7 @@ ..(W, user) /obj/structure/flora/proc/can_harvest(var/obj/item/I, var/ignore_tool = FALSE) - . = FALSE - if((ignore_tool || (harvest_tool && istype(I, harvest_tool))) && harvest_loot && harvest_loot.len && harvest_count < max_harvests) - . = TRUE - return . + return ((ignore_tool || (harvest_tool && istype(I, harvest_tool))) && harvest_loot && harvest_loot.len && harvest_count < max_harvests) /obj/structure/flora/proc/spawn_harvest(var/path = null, var/mob/user = null) if(!ispath(path)) diff --git a/code/game/objects/structures/flora/trees.dm b/code/game/objects/structures/flora/trees.dm index b7d70d64c6..a5ce24c60d 100644 --- a/code/game/objects/structures/flora/trees.dm +++ b/code/game/objects/structures/flora/trees.dm @@ -31,10 +31,7 @@ return icon_state /obj/structure/flora/tree/can_harvest(var/obj/item/I, var/ignore_tool = FALSE) - . = FALSE - if(!is_stump && (ignore_tool || (harvest_tool && istype(I, harvest_tool))) && harvest_loot && harvest_loot.len && harvest_count < max_harvests) - . = TRUE - return . + return (!is_stump && (ignore_tool || (harvest_tool && istype(I, harvest_tool))) && harvest_loot && harvest_loot.len && harvest_count < max_harvests) /obj/structure/flora/tree/attackby(var/obj/item/W, var/mob/living/user) if(can_harvest(W))