Fix: Prevent addtimer with qdeleted object in MouseEntered (#22557)

* Please describe the intent of your changes in a clear fashion.
This PR addresses an error where `addtimer` was called with a callback
assigned to a `qdeleted` object, specifically observed when
`MouseEntered` was triggered on items that self-delete, such as the
robotic combitool when dropped.

The root cause was that the `QDELETED(src)` check in
`/obj/item/MouseEntered` was performed *after* the `addtimer` call. This
allowed a timer to be registered for an object that was already marked
for deletion.

The fix involves moving the `if(QDELETED(src)) return` statement to
occur *before* any `addtimer` calls within the `MouseEntered` proc. This
ensures that if an item is already deleted, the function returns
immediately, preventing the creation of timers bound to invalid objects.
* 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-4F

---------

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
This commit is contained in:
sentry[bot]
2026-06-01 10:32:49 +00:00
committed by GitHub
co-authored by sentry[bot] <39604003+sentry[bot]@users.noreply.github.com> VMSolidus
parent 7978efa75f
commit b07b1a5c85
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -1328,10 +1328,10 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
. = ..()
if(in_inventory || in_storage)
var/mob/user = usr
if(!(user.client.prefs.toggles_secondary & HIDE_ITEM_TOOLTIPS))
tip_timer = addtimer(CALLBACK(src, PROC_REF(openTip), location, control, params, user), 8, TIMER_STOPPABLE)
if(QDELETED(src))
return
if(!(user.client.prefs.toggles_secondary & HIDE_ITEM_TOOLTIPS))
tip_timer = addtimer(CALLBACK(src, PROC_REF(openTip), location, control, params, user), 8, TIMER_STOPPABLE)
if(!(user.client.prefs.toggles_secondary & SEE_ITEM_OUTLINES))
return
var/mob/living/L = user