mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
[MIRROR] Fixes cargo manifest exports. (#7265)
* Fixes cargo manifest exports. (#60538) * Fixes cargo manifest exports. Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -69,6 +69,8 @@ Then the player gets the profit from selling his own wasted time.
|
||||
var/message = ""
|
||||
/// Cost of item, in cargo credits. Must not allow for infinite price dupes, see above.
|
||||
var/cost = 1
|
||||
/// whether this export can have a negative impact on the cargo budget or not
|
||||
var/allow_negative_cost = FALSE
|
||||
/// coefficient used in marginal price calculation that roughly corresponds to the inverse of price elasticity, or "quantity elasticity"
|
||||
var/k_elasticity = 1/30
|
||||
/// The multiplier of the amount sold shown on the report. Useful for exports, such as material, which costs are not strictly per single units sold.
|
||||
@@ -146,7 +148,7 @@ Then the player gets the profit from selling his own wasted time.
|
||||
///Utilized in the pricetag component. Splits the object's profit when it has a pricetag by the specified amount.
|
||||
var/profit_ratio = 0
|
||||
|
||||
if(amount <=0 || the_cost <=0)
|
||||
if(amount <=0 || (the_cost <=0 && !allow_negative_cost))
|
||||
return FALSE
|
||||
if(dry_run == FALSE)
|
||||
if(SEND_SIGNAL(O, COMSIG_ITEM_SOLD, item_value = get_cost(O, apply_elastic)) & COMSIG_ITEM_SPLIT_VALUE)
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
/datum/export/manifest_error
|
||||
unit_name = "erroneously approved manifest"
|
||||
export_types = list(/obj/item/paper/fluff/jobs/cargo/manifest)
|
||||
allow_negative_cost = TRUE
|
||||
|
||||
/datum/export/manifest_error/applies_to(obj/O)
|
||||
if(!..())
|
||||
@@ -60,9 +61,10 @@
|
||||
// Erroneously denied manifest.
|
||||
// Substracts the package cost minus the cost of crate.
|
||||
/datum/export/manifest_correct_denied
|
||||
cost = CARGO_CRATE_VALUE
|
||||
cost = -CARGO_CRATE_VALUE
|
||||
unit_name = "erroneously denied manifest"
|
||||
export_types = list(/obj/item/paper/fluff/jobs/cargo/manifest)
|
||||
allow_negative_cost = TRUE
|
||||
|
||||
/datum/export/manifest_correct_denied/applies_to(obj/O)
|
||||
if(!..())
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
P.update_appearance()
|
||||
return P
|
||||
|
||||
/datum/supply_order/proc/generateManifest(obj/container, owner, packname) //generates-the-manifests.
|
||||
var/obj/item/paper/fluff/jobs/cargo/manifest/P = new(container, id, 0)
|
||||
/datum/supply_order/proc/generateManifest(obj/container, owner, packname, cost) //generates-the-manifests.
|
||||
var/obj/item/paper/fluff/jobs/cargo/manifest/P = new(container, id, cost)
|
||||
|
||||
var/station_name = (P.errors & MANIFEST_ERROR_NAME) ? new_station_name() : station_name()
|
||||
|
||||
@@ -115,11 +115,11 @@
|
||||
else
|
||||
account_holder = "Cargo"
|
||||
var/obj/structure/closet/crate/C = pack.generate(A, paying_account)
|
||||
generateManifest(C, account_holder, pack)
|
||||
generateManifest(C, account_holder, pack, pack.cost)
|
||||
return C
|
||||
|
||||
/datum/supply_order/proc/generateCombo(miscbox, misc_own, misc_contents)
|
||||
/datum/supply_order/proc/generateCombo(miscbox, misc_own, misc_contents, misc_cost)
|
||||
for (var/I in misc_contents)
|
||||
new I(miscbox)
|
||||
generateManifest(miscbox, misc_own, "")
|
||||
generateManifest(miscbox, misc_own, "", misc_cost)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user