From 5f090aea5ea5b8865a78f1aba6dab9bb7da5270d Mon Sep 17 00:00:00 2001 From: GPeckman <21979502+GPeckman@users.noreply.github.com> Date: Fri, 6 Oct 2023 07:40:43 -0400 Subject: [PATCH] Adds sanity checking to the tippable component (#78771) ## About The Pull Request The tippable component doesn't actually have any sanity checking for if the tippable thing has already been tipped. This means that if two people try to tip something over at the same time, it will appear untipped but be immobilized as though it were tipped. The sprite will also stay permanently flipped until the bug is preformed again. Now that doesn't happen. Closes #64232. ## Why It's Good For The Game As funny as it is to see upside-down borgs running around, its still a bug. ## Changelog :cl: fix: Borgs will no longer become permanently upside-down if tipped over by multiple people at the same time. /:cl: --- code/datums/components/tippable.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/datums/components/tippable.dm b/code/datums/components/tippable.dm index eafb2345818..ee1f2c40547 100644 --- a/code/datums/components/tippable.dm +++ b/code/datums/components/tippable.dm @@ -133,6 +133,8 @@ /datum/component/tippable/proc/do_tip(mob/living/tipped_mob, mob/tipper) if(QDELETED(tipped_mob)) CRASH("Tippable component: do_tip() called with QDELETED tipped_mob!") + if (is_tipped) // sanity check in case multiple people try to tip at the same time + return to_chat(tipper, span_warning("You tip over [tipped_mob].")) if (!isnull(tipped_mob.client)) @@ -185,6 +187,8 @@ /datum/component/tippable/proc/do_untip(mob/living/tipped_mob, mob/untipper) if(QDELETED(tipped_mob)) return + if (!is_tipped) // sanity check in case multiple people try to untip at the same time + return to_chat(untipper, span_notice("You right [tipped_mob].")) tipped_mob.visible_message(