Code Readability - Hydroponics/lid_state is a bit unclear (#18235)

* lid_state to lid_open

* lid_open should actually be lid_closed
This commit is contained in:
KalevTait
2022-07-10 13:59:48 +01:00
committed by GitHub
parent 6a91840962
commit ab73add7bd
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -24,7 +24,7 @@
var/obj/item/seeds/myseed = null //The currently planted seed
var/rating = 1
var/wrenchable = TRUE
var/lid_state = 0
var/lid_closed = FALSE
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpollinate one plant
var/using_irrigation = FALSE //If the tray is connected to other trays via irrigation hoses
var/self_sufficiency_req = 20 //Required total dose to make a self-sufficient hydro tray. 1:1 with earthsblood.
@@ -123,8 +123,8 @@
if(!user || user.stat || user.restrained())
return
lid_state = !lid_state
to_chat(user, "<span class='notice'>You [lid_state ? "close" : "open"] the tray's lid.</span>")
lid_closed = !lid_closed
to_chat(user, "<span class='notice'>You [lid_closed ? "close" : "open"] the tray's lid.</span>")
update_icon()
@@ -286,7 +286,7 @@
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "gaia_blessing")
set_light(3)
if(lid_state)
if(lid_closed)
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "hydrocover")
update_icon_hoses()
@@ -924,7 +924,7 @@
/obj/machinery/hydroponics/attack_hand(mob/user)
if(issilicon(user)) //How does AI know what plant is?
return
if(lid_state)
if(lid_closed)
to_chat(user, "<span class='warning'>You can't reach the plant through the cover.</span>")
return
if(harvest)
@@ -196,7 +196,7 @@
generate_bee_visuals()
/mob/living/simple_animal/hostile/poison/bees/proc/pollinate(obj/machinery/hydroponics/Hydro)
if(!istype(Hydro) || !Hydro.myseed || Hydro.dead || Hydro.recent_bee_visit || Hydro.lid_state)
if(!istype(Hydro) || !Hydro.myseed || Hydro.dead || Hydro.recent_bee_visit || Hydro.lid_closed)
target = null
return