Skip to content

Commit

Permalink
[MIRROR] [NO GBP] Fix curators not getting a cut from patronized pain…
Browse files Browse the repository at this point in the history
…tings in a better way (#1588)

* [NO GBP] Fix curators not getting a cut from patronized paintings in a better way (#82159)

## About The Pull Request
I'm giving all the credits of this PR to the creator of #82153. The
reason I'm making this PR is because, while the other fix work too, I
believe this one is perhaps better so that we won't have to call
`SSjob.GetJobType(jobtype)` everytime we want to access or make use of
the `bank_accounts_by_job` variable.

## Why It's Good For The Game
See title, also the other PR if you want a more indepth explaination of
relatively simple stuff.

## Changelog
:cl: 00-Steven
fix: Fixed patronizing paintings not giving a cut to the curators.
/:cl:

* [NO GBP] Fix curators not getting a cut from patronized paintings in a better way

---------

Co-authored-by: Ghom <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Mar 23, 2024
1 parent 9aba8d1 commit 14d55ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/controllers/subsystem/economy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SUBSYSTEM_DEF(economy)
* A list of sole account datums can be obtained with flatten_list(), another variable would be redundant rn.
*/
var/list/bank_accounts_by_id = list()
/// A list of bank accounts indexed by their assigned job.
/// A list of bank accounts indexed by their assigned job typepath.
var/list/bank_accounts_by_job = list()
///List of the departmental budget cards in existance.
var/list/dep_cards = list()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/economy/account.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/datum/bank_account/Destroy()
if(add_to_accounts)
SSeconomy.bank_accounts_by_id -= "[account_id]"
SSeconomy.bank_accounts_by_job[account_job] -= src
SSeconomy.bank_accounts_by_job[account_job.type] -= src
QDEL_LIST(redeemed_coupons)
return ..()

Expand All @@ -72,7 +72,7 @@
stack_trace("Unable to find a unique account ID, substituting currently existing account of id [account_id].")
SSeconomy.bank_accounts_by_id["[account_id]"] = src
if(account_job)
LAZYADD(SSeconomy.bank_accounts_by_job[account_job], src)
LAZYADD(SSeconomy.bank_accounts_by_job[account_job.type], src)

/datum/bank_account/vv_edit_var(var_name, var_value) // just so you don't have to do it manually
var/old_id = account_id
Expand Down

0 comments on commit 14d55ab

Please sign in to comment.