Merge pull request #1933 from CHOMPStationBot/upstream-merge-10280

[MIRROR] Allow more than one ore processor
This commit is contained in:
Razgriz
2021-05-11 15:48:51 -07:00
committed by GitHub
8 changed files with 35 additions and 35 deletions

View File

@@ -73,7 +73,7 @@
for(var/ore in machine.ores_processing)
if(!machine.ores_stored[ore] && !show_all_ores)
continue
var/ore/O = ore_data[ore]
var/ore/O = GLOB.ore_data[ore]
if(!O)
continue
data["ores"].Add(list(list(
@@ -160,7 +160,6 @@
var/sheets_per_tick = 10
var/list/ores_processing[0]
var/list/ores_stored[0]
var/static/list/alloy_data
var/active = FALSE
var/points = 0
@@ -188,24 +187,13 @@
"verdantium" = 60,
"rutile" = 40) //VOREStation Add
/obj/machinery/mineral/processing_unit/New()
..()
// initialize static alloy_data list
if(!alloy_data)
alloy_data = list()
for(var/alloytype in typesof(/datum/alloy)-/datum/alloy)
alloy_data += new alloytype()
// TODO - Initializing this here is insane. Put it in global lists init or something. ~Leshana
if(!ore_data || !ore_data.len)
for(var/oretype in typesof(/ore)-/ore)
var/ore/OD = new oretype()
ore_data[OD.name] = OD
ores_processing[OD.name] = 0
ores_stored[OD.name] = 0
/obj/machinery/mineral/processing_unit/Initialize()
. = ..()
for(var/ore in GLOB.ore_data)
var/ore/OD = GLOB.ore_data[ore]
ores_processing[OD.name] = 0
ores_stored[OD.name] = 0
// TODO - Eschew input/output machinery and just use dirs ~Leshana
//Locate our output and input machinery.
for (var/dir in cardinal)
@@ -264,13 +252,13 @@
if(ores_stored[metal] > 0 && ores_processing[metal] != 0)
var/ore/O = ore_data[metal]
var/ore/O = GLOB.ore_data[metal]
if(!O) continue
if(ores_processing[metal] == PROCESS_ALLOY && O.alloy) //Alloying.
for(var/datum/alloy/A in alloy_data)
for(var/datum/alloy/A in GLOB.alloy_data)
if(A.metaltag in tick_alloys)
continue

View File

@@ -664,7 +664,7 @@ turf/simulated/mineral/floor/light_corner
else
mineral_name = pickweight(list("marble" = 3,/* "quartz" = 10,*/ "copper" = 20, "tin" = 15, "bauxite" = 15, "uranium" = 10, "platinum" = 10, "hematite" = 70, "rutile" = 15, "carbon" = 70, "diamond" = 2, "gold" = 10, "silver" = 10, "phoron" = 20, "lead" = 3,/* "void opal" = 1,*/ "verdantium" = 1/*, "painite" = 1*/))
if(mineral_name && (mineral_name in ore_data))
mineral = ore_data[mineral_name]
if(mineral_name && (mineral_name in GLOB.ore_data))
mineral = GLOB.ore_data[mineral_name]
UpdateMineral()
update_icon()

View File

@@ -21,7 +21,7 @@
/obj/effect/mineral/proc/get_scan_overlay()
if(!scanner_image)
var/ore/O = ore_data[ore_key]
var/ore/O = GLOB.ore_data[ore_key]
if(O)
scanner_image = image(icon, loc = get_turf(src), icon_state = (O.scan_icon ? O.scan_icon : icon_state))
else

View File

@@ -1,5 +1,3 @@
var/global/list/ore_data = list()
/ore
var/name
var/display_name