From 18ff30088f021bfab3f4921b2b8c3bfb827cadc2 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:29:56 -0700 Subject: [PATCH] Fix Imaginary Friends Initialization (#4730) # About the pull request This PR fixes the runtime that occurs during the initialization of an imaginary friend preventing the appearance from getting set up until the user manually requests to change their appearance yet again. The altered code probably could be removed altogether, but maybe there are scenarios where the ghost won't be null. # Explain why it's good for the game Features should not break or throw runtimes. # Testing Photographs and Procedure
Screenshots & Videos ![image](https://github.com/cmss13-devs/cmss13/assets/76988376/f0e66ecc-95a6-491f-8515-797c79923339)
# Changelog :cl: Drathek fix: Fixed imaginary friends not initializing correctly and throwing a runtime /:cl: --- code/modules/mob/camera/imaginary_friend.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/camera/imaginary_friend.dm b/code/modules/mob/camera/imaginary_friend.dm index 3d6d5d5a0aa2..5d205dd17e4f 100644 --- a/code/modules/mob/camera/imaginary_friend.dm +++ b/code/modules/mob/camera/imaginary_friend.dm @@ -261,7 +261,7 @@ icon = friend_image mouse_opacity = MOUSE_OPACITY_ICON var/mob/ghost = ..() - if(ghost.mind) + if(ghost?.mind) ghost.mind.original = aghosted_original_mob return ghost