Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Oct 2, 2023
1 parent a00f524 commit 071d782
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,15 @@ cases. Override_icon_state should be a list.*/
INVOKE_ASYNC(user, TYPE_PROC_REF(/atom, visible_message), SPAN_NOTICE("[user] looks up from [zoom_device]."),
SPAN_NOTICE("You look up from [zoom_device]."))
zoom = !zoom

// Due to how qdel calls back when the item is destroyed we lack a user, if we are still zoomed in and the item is being destroyed it should be in the direct contents of the user (hypothetically).
// When you read this in 10 years from now when it stops working uuuh sorry about that.
if(!user)
user = loc
if(!istype(user))
log_debug("[src] called unzoom without a user and user was not loc. Current loc: [loc ? loc : "null"]")
return

COOLDOWN_START(user, zoom_cooldown, 20)
SEND_SIGNAL(user, COMSIG_LIVING_ZOOM_OUT, src)
SEND_SIGNAL(src, COMSIG_ITEM_UNZOOM, user)
Expand Down

0 comments on commit 071d782

Please sign in to comment.