Skip to content

Commit

Permalink
[MODULAR] Fixes a nif related runtime with update_theme (#24392)
Browse files Browse the repository at this point in the history
* Fixes a nif related runtime I saw

* Update soulcatcher.dm

* Also add some preference checking while we're at it
  • Loading branch information
vinylspiders authored and FFMirrorBot committed Oct 17, 2023
1 parent c528e7a commit f34f6c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

RegisterSignal(new_soulcatcher, COMSIG_QDELETING, PROC_REF(no_soulcatcher_component))
linked_soulcatcher = WEAKREF(new_soulcatcher)
update_theme() // because we have to do this after the soulcatcher is linked

/datum/nifsoft/soulcatcher/activate()
. = ..()
Expand Down Expand Up @@ -99,6 +100,9 @@
if(!.)
return FALSE // uhoh

if(isnull(linked_soulcatcher))
return FALSE

var/datum/component/soulcatcher/current_soulcatcher = linked_soulcatcher.resolve()
if(!istype(current_soulcatcher))
stack_trace("[src] ([REF(src)]) tried to update its theme when it was missing a linked_soulcatcher component!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,12 @@ GLOBAL_LIST_EMPTY(soulcatchers)

/mob/dead/observer/Login()
. = ..()
var/soulcatcher_action_given = client.prefs.read_preference(/datum/preference/toggle/soulcatcher_join_action)
var/datum/preferences/preferences = client?.prefs
var/soulcatcher_action_given

if(preferences)
soulcatcher_action_given = preferences.read_preference(/datum/preference/toggle/soulcatcher_join_action)

if(!soulcatcher_action_given)
return

Expand Down

0 comments on commit f34f6c0

Please sign in to comment.