From 46152ac50e9d3714ece538ca69615e38a46db937 Mon Sep 17 00:00:00 2001 From: dwasint <82520990+dwasint@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:59:15 -0800 Subject: [PATCH] Patreon stacking tokens fix (#4618) * converts tokens to build per month * part 2 automates the metacoins * Update preferences.dm * Update code/modules/client/preferences.dm * stuff * Update meta_tokens.dm * Update meta_tokens.dm --------- Co-authored-by: Lucy --- monkestation/code/datums/meta_tokens.dm | 7 ++++++- monkestation/code/modules/client/preferences.dm | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/monkestation/code/datums/meta_tokens.dm b/monkestation/code/datums/meta_tokens.dm index b1ff622e8870..a4f278f4da68 100644 --- a/monkestation/code/datums/meta_tokens.dm +++ b/monkestation/code/datums/meta_tokens.dm @@ -59,6 +59,10 @@ GLOBAL_LIST_INIT(patreon_etoken_values, list( /datum/meta_token_holder/proc/convert_list_to_tokens(list/saved_tokens) if(!length(saved_tokens)) return + for(var/token in saved_tokens) + if(isnull(saved_tokens[token])) + saved_tokens[token] = 0 + total_low_threat_tokens = saved_tokens["low_threat"] total_medium_threat_tokens = saved_tokens["medium_threat"] total_high_threat_tokens = saved_tokens["high_threat"] @@ -92,13 +96,14 @@ GLOBAL_LIST_INIT(patreon_etoken_values, list( if(!patreon?.has_access(ACCESS_COMMAND_RANK)) return FALSE var/month_number = text2num(time2text(world.time, "MM")) - owner.prefs.token_month = month_number if(owner.prefs.token_month != month_number) owner.prefs.adjust_metacoins(owner?.ckey, 10000, "Monthly Monkecoin rations.", TRUE, FALSE, FALSE) if(!patreon.has_access(ACCESS_TRAITOR_RANK)) owner.prefs.save_preferences() + owner.prefs.token_month = month_number return FALSE if(owner.prefs.token_month == month_number) + owner.prefs.token_month = month_number return FALSE donator_token++ owner.prefs.token_month = month_number diff --git a/monkestation/code/modules/client/preferences.dm b/monkestation/code/modules/client/preferences.dm index c8c7b67c98c9..773a4b31cc59 100644 --- a/monkestation/code/modules/client/preferences.dm +++ b/monkestation/code/modules/client/preferences.dm @@ -28,6 +28,7 @@ "low_threat" = 0, "event_tokens" = 0, "event_token_month" = 0, + "donator" = 0, ) ///amount of metaconis you can earn per shift