From 207ffd13cc4867d094d670aa424a47185013d16e Mon Sep 17 00:00:00 2001
From: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Date: Thu, 1 Feb 2024 06:28:10 -0600
Subject: [PATCH] Fixes runtime from examining mod PCs (#81200)
## About The Pull Request
It's a classic

`EXAMINE_HINT(x)` resolves to `"" + x + ""`
When placed in this line directly, you get:
`["" + HAS_TRAIT_FROM(...) ? "..." : "..." + ""]`
You see the issue, right?
This resolves as you would expect:
`("" + HAS_TRAIT_FROM(...)) ? ("...") : ("..." + "")`
Which, of course, runtimes as it's adding a string to an integer (0).
By pulling it out to its own var we can get around this:
`["" + frame_or_pc + ""]`
## Changelog
:cl: Melbert
fix: Fixed examining modular PCs
/:cl:
---
.../modular_computers/computers/machinery/modular_computer.dm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm
index 63a1d005169..8fb32244e1d 100644
--- a/code/modules/modular_computers/computers/machinery/modular_computer.dm
+++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm
@@ -70,7 +70,8 @@
/obj/machinery/modular_computer/examine(mob/user)
. = cpu?.examine(user) || ..()
. += span_info("You can toggle interaction between computer and its machinery frame with [EXAMINE_HINT("Right-Click")] while empty-handed.")
- . += span_info("Currently interacting with [EXAMINE_HINT(HAS_TRAIT_FROM(src, TRAIT_MODPC_INTERACTING_WITH_FRAME, REF(user)) ? "frame" : "computer")].")
+ var/frame_or_pc = HAS_TRAIT_FROM(src, TRAIT_MODPC_INTERACTING_WITH_FRAME, REF(user)) ? "frame" : "computer"
+ . += span_info("Currently interacting with [EXAMINE_HINT(frame_or_pc)].")
/obj/machinery/modular_computer/attack_ghost(mob/dead/observer/user)
. = ..()