Ores now stack when released from ore box. Should help reduce some mining lag.

This commit is contained in:
Erthilo
2012-08-19 01:59:53 +01:00
parent a93db06afb
commit 08b2b326e9
4 changed files with 137 additions and 9 deletions

View File

@@ -27,6 +27,48 @@
if (src.output && src.input)
if (locate(/obj/structure/ore_box, input.loc))
var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc)
BOX.update()
if (BOX.amt_diamond > 0)
var/obj/item/weapon/ore/diamond/G = new /obj/item/weapon/ore/diamond
G.amount = BOX.amt_diamond
G.loc = output.loc
BOX.amt_diamond = 0
if (BOX.amt_glass > 0)
var/obj/item/weapon/ore/glass/G = new /obj/item/weapon/ore/glass
G.amount = BOX.amt_glass
G.loc = output.loc
BOX.amt_glass = 0
if (BOX.amt_plasma > 0)
var/obj/item/weapon/ore/plasma/G = new /obj/item/weapon/ore/plasma
G.amount = BOX.amt_plasma
G.loc = output.loc
BOX.amt_plasma = 0
if (BOX.amt_iron > 0)
var/obj/item/weapon/ore/iron/G = new /obj/item/weapon/ore/iron
G.amount = BOX.amt_iron
G.loc = output.loc
BOX.amt_iron = 0
if (BOX.amt_silver > 0)
var/obj/item/weapon/ore/silver/G = new /obj/item/weapon/ore/silver
G.amount = BOX.amt_silver
G.loc = output.loc
BOX.amt_silver = 0
if (BOX.amt_gold > 0)
var/obj/item/weapon/ore/gold/G = new /obj/item/weapon/ore/gold
G.amount = BOX.amt_gold
G.loc = output.loc
BOX.amt_gold = 0
if (BOX.amt_uranium > 0)
var/obj/item/weapon/ore/uranium/G = new /obj/item/weapon/ore/uranium
G.amount = BOX.amt_uranium
G.loc = output.loc
BOX.amt_uranium = 0
if (BOX.amt_clown > 0)
var/obj/item/weapon/ore/clown/G = new /obj/item/weapon/ore/clown
G.amount = BOX.amt_clown
G.loc = output.loc
BOX.amt_clown = 0
var/i = 0
for (var/obj/item/weapon/ore/O in BOX.contents)
BOX.contents -= O