Optimized the mineral processing machine a bit

This commit is contained in:
Albert Iordache
2012-07-12 15:40:13 +03:00
parent ff91b3d499
commit aab476a847

View File

@@ -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)