diff --git a/code/modules/cargo/exports.dm b/code/modules/cargo/exports.dm index 51c4864034..fca10ac01c 100644 --- a/code/modules/cargo/exports.dm +++ b/code/modules/cargo/exports.dm @@ -24,7 +24,8 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they var/list/exported_atoms = list()//names of atoms sold/deleted by export var/list/total_amount = list() //export instance => total count of sold objects of its type, only exists if any were sold var/list/total_value = list() //export instance => total value of sold objects - var/list/total_reagents = list()//export reagents => into the total vaule of the object sold + var/list/reagents_volume = list()//export reagents => into the total volume of the object sold + var/list/reagents_value = list()//export reagents => into the reagent type total value. // external_report works as "transaction" object, pass same one in if you're doing more than one export in single go /proc/export_item_and_contents(atom/movable/AM, allowed_categories = EXPORT_CARGO, apply_elastic = TRUE, delete_unsold = TRUE, dry_run=FALSE, datum/export_report/external_report) @@ -49,8 +50,12 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they report.exported_atoms += " [thing.name]" break if(thing.reagents) - for(var/datum/reagent/R in thing.reagents.reagent_list) - report.total_reagents[R] += R.volume + for(var/A in thing.reagents.reagent_list) + var/datum/reagent/R = A + if(!R.value) + continue + report.reagents_volume[R.name] += R.volume + report.reagents_value[R.name] += R.volume * R.value if(!dry_run && (sold || delete_unsold)) if(ismob(thing)) thing.investigate_log("deleted through cargo export",INVESTIGATE_CARGO) diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 2ac6df7668..0db05cb83d 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -166,13 +166,12 @@ GLOBAL_LIST_INIT(cargo_shuttle_leave_behind_typecache, typecacheof(list( msg += export_text + "\n" SSshuttle.points += ex.total_value[E] - for(var/datum/reagent/R in ex.total_reagents) - var/amount = ex.total_reagents[R] - var/value = amount*R.value - if(!value) - continue - msg += "[value] credits: received [amount]u of [R.name].\n" + for(var/chem in ex.reagents_value) + var/value = ex.reagents_value[chem] + msg += "[value] credits: received [ex.reagents_volume[chem]]u of [chem].\n" SSshuttle.points += value + msg = copytext(msg, 1, MAX_MESSAGE_LEN) + SSshuttle.centcom_message = msg investigate_log("Shuttle contents sold for [SSshuttle.points - presale_points] credits. Contents: [ex.exported_atoms || "none."] Message: [SSshuttle.centcom_message || "none."]", INVESTIGATE_CARGO)