From 43014a8729cbcea4d0dfba45ffc34a153a2695d8 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Tue, 5 Nov 2019 07:33:43 +0100 Subject: [PATCH 1/2] Riding component fix and hacky mood runtimes workaround. --- code/datums/components/mood.dm | 6 +++++- code/datums/components/riding.dm | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 8c6013aeab..06ff726fff 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -21,6 +21,7 @@ RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, .proc/add_event) RegisterSignal(parent, COMSIG_CLEAR_MOOD_EVENT, .proc/clear_event) RegisterSignal(parent, COMSIG_MODIFY_SANITY, .proc/modify_sanity) + RegisterSignal(parent, COMSIG_PARENT_QDELETED, .proc/work_around) // hacky work around to an obnoxious runtime issue we haven't found the source of yet. RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, .proc/modify_hud) var/mob/living/owner = parent @@ -34,6 +35,9 @@ unmodify_hud() return ..() +/datum/component/mood/proc/work_around(datum/source) // I'm sorry and tired. + qdel(src) + /datum/component/mood/proc/print_mood(mob/user) var/msg = "*---------*\nYour current mood\n" msg += "My mental status: " //Long term @@ -249,7 +253,7 @@ RegisterSignal(screen_obj, COMSIG_CLICK, .proc/hud_click) /datum/component/mood/proc/unmodify_hud(datum/source) - if(!screen_obj) + if(!screen_obj || !parent) return var/mob/living/owner = parent var/datum/hud/hud = owner.hud_used diff --git a/code/datums/components/riding.dm b/code/datums/components/riding.dm index dcdbd5ca4b..c05b07a693 100644 --- a/code/datums/components/riding.dm +++ b/code/datums/components/riding.dm @@ -310,10 +310,10 @@ if(!user.put_in_hands(inhand, TRUE)) qdel(inhand) // it isn't going to be added to offhands anyway break - LAZYADD(equipped, src) + LAZYADD(equipped, inhand) var/amount_equipped = LAZYLEN(equipped) if(amount_equipped) - LAZYADD(offhands[L], amount_equipped) + LAZYADD(offhands[L], equipped) if(amount_equipped >= amount_required) return TRUE unequip_buckle_inhands(L) From 7348693338517081adb571830cdcf1742c39109a Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Tue, 12 Nov 2019 15:53:54 +0100 Subject: [PATCH 2/2] chucklefucks. --- code/datums/components/mood.dm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 06ff726fff..cf9e5a08cd 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -21,7 +21,6 @@ RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, .proc/add_event) RegisterSignal(parent, COMSIG_CLEAR_MOOD_EVENT, .proc/clear_event) RegisterSignal(parent, COMSIG_MODIFY_SANITY, .proc/modify_sanity) - RegisterSignal(parent, COMSIG_PARENT_QDELETED, .proc/work_around) // hacky work around to an obnoxious runtime issue we haven't found the source of yet. RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, .proc/modify_hud) var/mob/living/owner = parent @@ -35,9 +34,6 @@ unmodify_hud() return ..() -/datum/component/mood/proc/work_around(datum/source) // I'm sorry and tired. - qdel(src) - /datum/component/mood/proc/print_mood(mob/user) var/msg = "*---------*\nYour current mood\n" msg += "My mental status: " //Long term @@ -129,6 +125,9 @@ screen_obj.icon_state = "mood[mood_level]" /datum/component/mood/process() //Called on SSmood process + if(QDELETED(parent)) // workaround to an obnoxious sneaky periodical runtime. + qdel(src) + return var/mob/living/owner = parent switch(mood_level)