Fix multiple pref issues (#18083)

* fix tail alyering pref

* .

* .

* .

* .

* -

* return

* fix that

* write needs save after

* urg

* ban slot change mid round

* -

* .

* properly save

* .

* queue to ss

* read current

* performance

* .

* .

* bit better optimized

* no resetsploit

* this works at least but is it proper (#13)

* this works at least but is it proper

* Update changeling.dm

* this too...

* dont be private

* fix asset ss

---------

Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
Kashargul
2025-08-10 04:13:15 +02:00
committed by GitHub
parent 7303f34565
commit d9787e171e
15 changed files with 107 additions and 55 deletions
+3 -3
View File
@@ -18,7 +18,7 @@
/mob/living/carbon/human/proc/birthday(var/birthday = 0)
var/msg
var/lastyear = read_preference(/datum/preference/numeric/human/last_bday_note)
write_preference_directly(/datum/preference/numeric/human/last_bday_note, GLOB.world_time_year) //We only want to ask once a year per character, this persists, update early in case of shenanigans
write_preference_directly(/datum/preference/numeric/human/last_bday_note, GLOB.world_time_year, WRITE_PREF_MANUAL) //We only want to ask once a year per character, this persists, update early in case of shenanigans
if(birthday) //woo
msg = "Today is your birthday! Do you want to increase your character's listed age?"
if(read_preference(/datum/preference/toggle/human/bday_announce))
@@ -34,6 +34,6 @@
var/howmuch = GLOB.world_time_year - lastyear
age += howmuch
to_chat(src, span_notice("You are now [age]! Happy birthday!"))
write_preference_directly(/datum/preference/numeric/human/age, age) //Set the age on the character sheet
write_preference_directly(/datum/preference/numeric/human/age, age, WRITE_PREF_MANUAL) //Set the age on the character sheet
client?.prefs.save_character() //Save the info
SScharacter_setup.queue_preferences_save(client?.prefs)