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 <evilexecutive@gmail.com>
This commit is contained in:
sentry[bot]
2026-08-20 15:29:48 +00:00
committed by GitHub
co-authored by VMSolidus
parent 4839724189
commit 933ae32a1a
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -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