From 933ae32a1ab43fc060f7d782e4f9f347a51b105c Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 15:29:48 +0000 Subject: [PATCH] Fix: Prevent on_user_login runtime when machine is a mob (#23061) * Please describe the intent of your changes in a clear fashion. This PR addresses a runtime error occurring in `mob/proc/LateLogin()` when `machine.on_user_login(src)` is called. The error happened when the `machine` variable on a mob was unexpectedly set to a `/mob/abstract/ghost/observer` (instead of an `/obj`), typically during the shared dreaming (Srom) wakeup process. The `on_user_login()` proc is defined on `/obj` but not on `/mob` types. The fix adds a type check `isobj(machine)` before attempting to call `machine.on_user_login(src)` in `code/modules/mob/login.dm`, ensuring the proc is only invoked when `machine` is indeed an object, thus preventing the 'undefined proc or verb' runtime. * Please make sure that, in the case of mapping changes, you include images of these changes in the PR's description. * Please make sure to mark your PR as wip or review required by making a comment with !wip or !review required * If you include sprites/sounds/... (assets) that you have not created yourself specify the license and original author below. * Ensure that you also credit them in the appropriate location / changelog as specified in the contributor guidelines ### Asset Licenses The following assets that **have not** been created by myself are included in this PR: | Path | Original Author | License | | --- | --- | --- | | icons/example.dmi | ExamplePerson (Example Station) | CC0 | Fixes [SERVER-PROD-2SZ](https://aurorastation.sentry.io/issues/7666863585/?seerDrawer=true) --------- Co-authored-by: VMSolidus --- code/modules/mob/login.dm | 2 +- html/changelogs/hellfirejag-a-small-machine-check.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/hellfirejag-a-small-machine-check.yml diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 13db1a0ba53..04a36a25d4f 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -103,7 +103,7 @@ if(client) //Should work based on "change_view" but we lack the infrastructure behind to make it useful, for now client.attempt_auto_fit_viewport() - if(machine) + if(isobj(machine)) machine.on_user_login(src) // Check code/modules/admin/verbs/antag-ooc.dm for definition diff --git a/html/changelogs/hellfirejag-a-small-machine-check.yml b/html/changelogs/hellfirejag-a-small-machine-check.yml new file mode 100644 index 00000000000..73935f51277 --- /dev/null +++ b/html/changelogs/hellfirejag-a-small-machine-check.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Fixed a runtime error caused by a 'machine' var being used to store non machines."