Converts Economy to a Subsystem (#5253)

Converts Economy to a Subsystem and cleans it up a bit
This commit is contained in:
Werner
2018-11-03 15:34:22 +02:00
committed by Erki
parent 866da21d57
commit a42e6a118b
19 changed files with 361 additions and 327 deletions
+2 -6
View File
@@ -4,9 +4,6 @@
#define SUPPLY_STATION_AREATYPE /area/supply/station //Type of the supply shuttle area for station
#define SUPPLY_DOCK_AREATYPE /area/supply/dock //Type of the supply shuttle area for dock
/proc/fetch_supply_account()
SScargo.supply_account = department_accounts["Cargo"]
var/datum/controller/subsystem/cargo/SScargo
/datum/controller/subsystem/cargo
@@ -67,8 +64,7 @@ var/datum/controller/subsystem/cargo/SScargo
ordernum = rand(1,8000)
shipmentnum = rand(500,700)
//Fetch the cargo account once the round is started - TODO-CARGO: Repalce that once economy gets its own subsystem
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/fetch_supply_account))
supply_account = SSeconomy.get_department_account("Cargo")
//Load in the cargo items config
if(config.cargo_load_items_from == "sql")
@@ -534,7 +530,7 @@ var/datum/controller/subsystem/cargo/SScargo
if(!supply_account)
log_debug("SScargo: Warning Tried to charge supply account but supply acount doesnt exist")
return 0
return charge_to_account(supply_account.account_number, "[commstation_name()] - Supply", "[charge_text]", "[commstation_name()] - Banking System", -charge_credits)
return SSeconomy.charge_to_account(supply_account.account_number, "[commstation_name()] - Supply", "[charge_text]", "[commstation_name()] - Banking System", -charge_credits)
//Gets the pending shipment costs for the items that are about to be shipped to the station
/datum/controller/subsystem/cargo/proc/get_pending_shipment_cost(var/status="approved")
//Loop through all the orders marked as shipped and get the suppliers into a list of involved suppliers