Skip to content

Commit

Permalink
Fixes chair/bed teleporting (#6006)
Browse files Browse the repository at this point in the history
# About the pull request
Fixes #5604, prevents placing mobs onto chairs, beds and tables unless
the mob is directly adjacent to the source tile. I'm hesitant to extend
this functionality for the autodoc/scanner and xeno nests as I could see
it getting very annoying quickly.

# Changelog

:cl:
fix: Fixes teleporting when placing mobs onto chairs and beds. 
/:cl:

---------

Co-authored-by: SabreML <[email protected]>
  • Loading branch information
vero5123 and SabreML authored Mar 28, 2024
1 parent 051c0bf commit c6989a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions code/game/objects/structures/stool_bed_chair_nest/bed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,14 @@
if(ismob(G.grabbed_thing))
var/mob/M = G.grabbed_thing
var/atom/blocker = LinkBlocked(user, user.loc, loc)
if(!Adjacent(M))
visible_message(SPAN_DANGER("[M] is too far to place onto [src]."))
return FALSE
if(blocker)
to_chat(user, SPAN_WARNING("\The [blocker] is in the way!"))
else
to_chat(user, SPAN_NOTICE("You place [M] on [src]."))
M.forceMove(loc)
return FALSE
to_chat(user, SPAN_NOTICE("You place [M] on [src]."))
M.forceMove(loc)
return TRUE

else
Expand Down

0 comments on commit c6989a6

Please sign in to comment.