From fdb48d033e14581ab141b5207123b056b4795113 Mon Sep 17 00:00:00 2001 From: RKz Date: Sun, 7 Jan 2024 20:19:00 -0500 Subject: [PATCH 1/3] fix --- code/modules/cargo/exports.dm | 17 ++++++++++++++--- code/modules/cargo/exports/materials.dm | 1 - 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/modules/cargo/exports.dm b/code/modules/cargo/exports.dm index dd52e57f8b569..e945e661dc11e 100644 --- a/code/modules/cargo/exports.dm +++ b/code/modules/cargo/exports.dm @@ -33,6 +33,7 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they var/list/contents = AM.GetAllContents() var/datum/export_report/report = external_report + if(!report) //If we don't have any longer transaction going on report = new @@ -40,6 +41,9 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they for(var/i in reverse_range(contents)) var/atom/movable/thing = i var/sold = FALSE + if(QDELETED(thing)) + continue + for(var/datum/export/E in GLOB.exports_list) if(!E) continue @@ -146,11 +150,18 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they return FALSE return TRUE -// Called only once, when the object is actually sold by the datum. -// Adds item's cost and amount to the current export cycle. -// get_cost, get_amount and applies_to do not neccesary mean a successful sale. +/** + * Calculates the exact export value of the object, while factoring in all the relivant variables. + * + * Called only once, when the object is actually sold by the datum. + * Adds item's cost and amount to the current export cycle. + * get_cost, get_amount and applies_to do not neccesary mean a successful sale. + * + */ /datum/export/proc/sell_object(obj/O, datum/export_report/report, dry_run = TRUE, allowed_categories = EXPORT_CARGO , apply_elastic = TRUE) + ///This is the value of the object, as derived from export datums. var/the_cost = get_cost(O, allowed_categories , apply_elastic) + ///Quantity of the object in question. var/amount = get_amount(O) if(amount <=0 || the_cost <=0) diff --git a/code/modules/cargo/exports/materials.dm b/code/modules/cargo/exports/materials.dm index dd8eccb93cd9d..98ee3dce61de1 100644 --- a/code/modules/cargo/exports/materials.dm +++ b/code/modules/cargo/exports/materials.dm @@ -41,7 +41,6 @@ /datum/export/material/plasma cost = 200 - k_elasticity = 0 material_id = /datum/material/plasma message = "cm3 of plasma" From 7ef85d348706a14ab80f2623e8b1345feec4656d Mon Sep 17 00:00:00 2001 From: RKz Date: Sun, 7 Jan 2024 20:25:09 -0500 Subject: [PATCH 2/3] fuhgettaboutit --- code/modules/cargo/exports.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/modules/cargo/exports.dm b/code/modules/cargo/exports.dm index e945e661dc11e..e735cd9d98539 100644 --- a/code/modules/cargo/exports.dm +++ b/code/modules/cargo/exports.dm @@ -41,8 +41,6 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they for(var/i in reverse_range(contents)) var/atom/movable/thing = i var/sold = FALSE - if(QDELETED(thing)) - continue for(var/datum/export/E in GLOB.exports_list) if(!E) From e81537aa09bfc7e4f4989dec8bc42885f1482ce0 Mon Sep 17 00:00:00 2001 From: RKz Date: Sun, 7 Jan 2024 20:36:20 -0500 Subject: [PATCH 3/3] you too --- code/modules/cargo/exports/materials.dm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/code/modules/cargo/exports/materials.dm b/code/modules/cargo/exports/materials.dm index 98ee3dce61de1..ef3f9fcce8718 100644 --- a/code/modules/cargo/exports/materials.dm +++ b/code/modules/cargo/exports/materials.dm @@ -32,37 +32,37 @@ /datum/export/material/bananium cost = 1000 material_id = /datum/material/bananium - message = "cm3 of bananium" + message = "cm3 of bananium" /datum/export/material/diamond cost = 500 material_id = /datum/material/diamond - message = "cm3 of diamonds" + message = "cm3 of diamonds" /datum/export/material/plasma cost = 200 material_id = /datum/material/plasma - message = "cm3 of plasma" + message = "cm3 of plasma" /datum/export/material/uranium cost = 100 material_id = /datum/material/uranium - message = "cm3 of uranium" + message = "cm3 of uranium" /datum/export/material/gold cost = 125 material_id = /datum/material/gold - message = "cm3 of gold" + message = "cm3 of gold" /datum/export/material/copper cost = 15 material_id = /datum/material/copper - message = "cm3 of copper" + message = "cm3 of copper" /datum/export/material/silver cost = 50 material_id = /datum/material/silver - message = "cm3 of silver" + message = "cm3 of silver" /datum/export/material/titanium cost = 125 @@ -72,7 +72,7 @@ /datum/export/material/adamantine cost = 500 material_id = /datum/material/adamantine - message = "cm3 of adamantine" + message = "cm3 of adamantine" /datum/export/material/bscrystal cost = 300 @@ -81,12 +81,12 @@ /datum/export/material/plastic cost = 25 - message = "cm3 of plastic" + message = "cm3 of plastic" material_id = /datum/material/plastic /datum/export/material/iron cost = 5 - message = "cm3 of metal" + message = "cm3 of metal" material_id = /datum/material/iron export_types = list( /obj/item/stack/sheet/iron, /obj/item/stack/tile/plasteel, @@ -94,7 +94,7 @@ /datum/export/material/glass cost = 5 - message = "cm3 of glass" + message = "cm3 of glass" material_id = /datum/material/glass export_types = list(/obj/item/stack/sheet/glass, /obj/item/stack/ore, /obj/item/shard)