Skip to content

Commit

Permalink
acc
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCastmer committed Apr 5, 2024
1 parent 9d64ebb commit 86e7a45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
/obj/machinery/computer/stockexchange/proc/balance()
if (!logged_in)
return 0
return SSeconomy.get_dep_account(ACCOUNT_CAR).account_balance
var/acc = SSeconomy.get_dep_account(ACCOUNT_CAR)
return acc.account_balance

Check warning on line 52 in modular_dripstation/code/modules/cargo/stockmarket/computer.dm

View workflow job for this annotation

GitHub Actions / Lints

field access requires static type: "account_balance"

///// MAIN TGUI SCREEN /////

Expand Down Expand Up @@ -279,7 +280,8 @@
if (!li)
to_chat(user, "<span class='danger'>No active account on the console!</span>")
return
var/b = SSeconomy.get_dep_account(ACCOUNT_CAR).account_balance
var/acc = SSeconomy.get_dep_account(ACCOUNT_CAR)
var/b = acc.account_balance

Check warning on line 284 in modular_dripstation/code/modules/cargo/stockmarket/computer.dm

View workflow job for this annotation

GitHub Actions / Lints

field access requires static type: "account_balance"
var/avail = S.shareholders[logged_in]
if (!avail)
to_chat(user, "<span class='danger'>This account does not own any shares of [S.name]!</span>")
Expand All @@ -294,7 +296,7 @@
return
if (li != logged_in)
return
b = SSeconomy.get_dep_account(ACCOUNT_CAR).account_balance
b = acc.account_balance

Check warning on line 299 in modular_dripstation/code/modules/cargo/stockmarket/computer.dm

View workflow job for this annotation

GitHub Actions / Lints

field access requires static type: "account_balance"
if (!isnum(b))
to_chat(user, "<span class='danger'>No active account on the console!</span>")
return
Expand Down
7 changes: 4 additions & 3 deletions modular_dripstation/code/modules/cargo/stockmarket/stocks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,11 @@
borrow_brokers += B

/datum/stock/proc/modifyAccount(whose, by, force=0)
if (SSeconomy.get_dep_account(ACCOUNT_CAR).account_balance)
if (by < 0 && SSeconomy.get_dep_account(ACCOUNT_CAR).account_balance + by < 0 && !force)
var/acc = SSeconomy.get_dep_account(ACCOUNT_CAR)
if (acc.account_balance)

Check warning on line 244 in modular_dripstation/code/modules/cargo/stockmarket/stocks.dm

View workflow job for this annotation

GitHub Actions / Lints

field access requires static type: "account_balance"
if (by < 0 && acc.account_balance + by < 0 && !force)

Check warning on line 245 in modular_dripstation/code/modules/cargo/stockmarket/stocks.dm

View workflow job for this annotation

GitHub Actions / Lints

field access requires static type: "account_balance"
return 0
SSeconomy.get_dep_account(ACCOUNT_CAR).account_balance += by
acc.account_balance += by

Check warning on line 247 in modular_dripstation/code/modules/cargo/stockmarket/stocks.dm

View workflow job for this annotation

GitHub Actions / Lints

field access requires static type: "account_balance"
GLOB.stockExchange.balanceLog(whose, by)
return 1
return 0
Expand Down

0 comments on commit 86e7a45

Please sign in to comment.