Streamlines flora harvest check.

This commit is contained in:
MistakeNot4892
2022-08-16 15:00:59 +10:00
parent 8535134bed
commit 2fff418057
2 changed files with 2 additions and 8 deletions
+1 -4
View File
@@ -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))
+1 -4
View File
@@ -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))