mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-09 00:43:55 +00:00
Preferences now store client key instead of the client itself.
For reasons unbeknown to me, the client var is reset when the client logs outs and thus the preference mob cease to be. Now stores the client key, and acquires the appropriate mob based on that, if possible. Also removes the sanitation check because the holder isn't set before the preferences are created. Fixes #12341.
This commit is contained in:
@@ -212,13 +212,13 @@
|
||||
/datum/category_item/player_setup_item/Topic(var/href,var/list/href_list)
|
||||
if(..())
|
||||
return 1
|
||||
var/mob/user = usr
|
||||
if(!user.client)
|
||||
var/mob/pref_mob = preference_mob()
|
||||
if(!pref_mob || !pref_mob.client)
|
||||
return 1
|
||||
|
||||
. = OnTopic(href, href_list, user)
|
||||
. = OnTopic(href, href_list, usr)
|
||||
if(. == TOPIC_REFRESH)
|
||||
user.client.prefs.ShowChoices(user)
|
||||
pref_mob.client.prefs.ShowChoices(usr)
|
||||
|
||||
/datum/category_item/player_setup_item/CanUseTopic(var/mob/user)
|
||||
return 1
|
||||
@@ -227,5 +227,4 @@
|
||||
return TOPIC_NOACTION
|
||||
|
||||
/datum/category_item/player_setup_item/proc/preference_mob()
|
||||
if(pref && pref.client && pref.client.mob)
|
||||
return pref.client.mob
|
||||
return get_mob_by_key(pref.client_ckey)
|
||||
|
||||
Reference in New Issue
Block a user