Skip to content

Commit

Permalink
Fix Imaginary Friends Initialization (#4730)
Browse files Browse the repository at this point in the history
# 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
<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/cmss13-devs/cmss13/assets/76988376/f0e66ecc-95a6-491f-8515-797c79923339)

</details>


# Changelog
:cl: Drathek
fix: Fixed imaginary friends not initializing correctly and throwing a
runtime
/:cl:
  • Loading branch information
Drulikar committed Oct 20, 2023
1 parent 837aff2 commit 18ff300
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/modules/mob/camera/imaginary_friend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 18ff300

Please sign in to comment.