moved money accounts into a global list + removed db syncing (some procs could be global but left where they are for convenience), fixed an issue with latejoiners having no account, fixed a runtime

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2013-07-12 03:40:06 +10:00
parent 67cc13751a
commit 4421bede17
5 changed files with 96 additions and 106 deletions

View File

@@ -8,12 +8,13 @@
var/obj/machinery/account_database/affected_db
/datum/event/money_hacker/setup()
for(var/obj/machinery/account_database/DB in world)
if( DB.z == 1 && !(DB.stat&NOPOWER) && DB.activated && DB.accounts.len)
affected_db = DB
break
if(all_money_accounts.len)
for(var/obj/machinery/account_database/DB in world)
if( DB.z == 1 && !(DB.stat&NOPOWER) && DB.activated )
affected_db = DB
break
if(affected_db)
affected_account = pick(affected_db.accounts)
affected_account = pick(all_money_accounts.len)
else
kill()
return

View File

@@ -7,8 +7,8 @@
/datum/event/money_lotto/start()
winner_sum = pick(5000, 10000, 50000, 100000, 500000, 1000000, 1500000)
if(centcomm_account_db.accounts.len)
var/datum/money_account/D = pick(centcomm_account_db.accounts)
if(all_money_accounts.len)
var/datum/money_account/D = pick(all_money_accounts)
D.money += winner_sum
var/datum/transaction/T = new()