From aab476a84778757b7fd02dc936fdc540d3f2576a Mon Sep 17 00:00:00 2001 From: Albert Iordache Date: Thu, 12 Jul 2012 15:40:13 +0300 Subject: [PATCH] Optimized the mineral processing machine a bit --- code/modules/mining/machine_processing.dm | 57 +++++++++-------------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index aaa6aaf8b44..043fd387afd 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -313,37 +313,27 @@ continue*/ - //if a non valid combination is selected - + // A non valid combination was selected var/b = 1 //this part checks if all required ores are available - if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron)) + if (!(selected_gold || selected_silver || selected_diamond || selected_uranium || selected_plasma || selected_iron || selected_glass || selected_clown)) + b = 0 + else if (selected_gold == 1 && ore_gold <= 0) + b = 0 + else if (selected_silver == 1 && ore_silver <= 0) + b = 0 + else if (selected_diamond == 1 && ore_diamond <= 0) + b = 0 + else if (selected_uranium == 1 && ore_uranium <= 0) + b = 0 + else if (selected_plasma == 1 && ore_plasma <= 0) + b = 0 + else if (selected_iron == 1 && ore_iron <= 0) + b = 0 + else if (selected_glass == 1 && ore_glass <= 0) + b = 0 + else if (selected_clown == 1 && ore_clown <= 0) b = 0 - - if (selected_gold == 1) - if (ore_gold <= 0) - b = 0 - if (selected_silver == 1) - if (ore_silver <= 0) - b = 0 - if (selected_diamond == 1) - if (ore_diamond <= 0) - b = 0 - if (selected_uranium == 1) - if (ore_uranium <= 0) - b = 0 - if (selected_plasma == 1) - if (ore_plasma <= 0) - b = 0 - if (selected_iron == 1) - if (ore_iron <= 0) - b = 0 - if (selected_glass == 1) - if (ore_glass <= 0) - b = 0 - if (selected_clown == 1) - if (ore_clown <= 0) - b = 0 if (b) //if they are, deduct one from each, produce slag and shut the machine off if (selected_gold == 1) @@ -361,13 +351,12 @@ if (selected_clown == 1) ore_clown-- new /obj/item/weapon/ore/slag(output.loc) - on = 0 - else - on = 0 - break - break - else + + on = 0 + + else // on == 0 break + for (i = 0; i < 10; i++) var/obj/item/O O = locate(/obj/item, input.loc)