Skip to content

Commit

Permalink
fixed single letter vars and implemented suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
doganesi committed May 24, 2024
1 parent fd42c40 commit f286823
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions code/game/machinery/seed_extractor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@
to_chat(user, SPAN_NOTICE("You start dumping the contents of [container] into [src]."))
if(!do_after(user, 1.5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC))
return
for(var/obj/item/item in container)
for(var/obj/item/item as anything in container)
if(!istype(item, /obj/item/reagent_container/food/snacks/grown) && !istype(item, /obj/item/grown))
to_chat(user, SPAN_WARNING("Cannot get seeds from [item]."))
break
else
if(user.temp_drop_inv_item(item))
var/datum/seed/new_seed_type
if(istype(item, /obj/item/grown))
var/obj/item/grown/F = item
new_seed_type = GLOB.seed_types[F.plantname]
var/obj/item/grown/plant = item
new_seed_type = GLOB.seed_types[plant.plantname]
else
var/obj/item/reagent_container/food/snacks/grown/F = item
new_seed_type = GLOB.seed_types[F.plantname]
var/obj/item/reagent_container/food/snacks/grown/plant = item
new_seed_type = GLOB.seed_types[plant.plantname]

if(new_seed_type)
to_chat(user, SPAN_NOTICE("You extract some seeds from [item]."))
var/produce = rand(1,4)
for(var/i = 0;i<=produce;i++)
for(var/i in 0 to produce)
var/obj/item/seeds/seeds = new (get_turf(src))
seeds.seed_type = new_seed_type.name
seeds.update_seed()
Expand All @@ -50,11 +50,11 @@
if(user.temp_drop_inv_item(O))
var/datum/seed/new_seed_type
if(istype(O, /obj/item/grown))
var/obj/item/grown/F = O
new_seed_type = GLOB.seed_types[F.plantname]
var/obj/item/grown/plant = O
new_seed_type = GLOB.seed_types[plant.plantname]
else
var/obj/item/reagent_container/food/snacks/grown/F = O
new_seed_type = GLOB.seed_types[F.plantname]
var/obj/item/reagent_container/food/snacks/grown/plant = O
new_seed_type = GLOB.seed_types[plant.plantname]

if(new_seed_type)
to_chat(user, SPAN_NOTICE("You extract some seeds from [O]."))
Expand All @@ -68,7 +68,7 @@
qdel(O)
//Grass.
else if(istype(O, /obj/item/stack/tile/grass))
var/obj/item/stack/tile/grass/S = O
if (S.use(1))
var/obj/item/stack/tile/grass/grass = O
if (grass.use(1))
to_chat(user, SPAN_NOTICE("You extract some seeds from the grass tile."))
new /obj/item/seeds/grassseed(loc)

0 comments on commit f286823

Please sign in to comment.