diff --git a/code/game/objects/structures/coathanger.dm b/code/game/objects/structures/coathanger.dm index 06b9acb0d32..1d2d70ebdf1 100644 --- a/code/game/objects/structures/coathanger.dm +++ b/code/game/objects/structures/coathanger.dm @@ -32,7 +32,7 @@ for(var/T in allowed) if(istype(W,T)) can_hang = TRUE - continue + break if(can_hang && !coat) add_fingerprint(user) @@ -43,22 +43,38 @@ else return ..() -/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0) +/obj/structure/coatrack/MouseDrop_T(obj/item/W, mob/user) var/can_hang = FALSE for(var/T in allowed) - if(istype(mover,T)) + if(istype(W,T)) can_hang = TRUE - continue + break if(can_hang && !coat) - visible_message("[mover] lands on \the [src].") - coat = mover - coat.loc = src + add_fingerprint(user) + user.visible_message("[user] hangs [W] on \the [src].", "You hang [W] on the \the [src].") + coat = W + user.drop_transfer_item_to_loc(W, src) update_icon() - return 0 else return ..() +// Hanging a coat on the hanger only after a bump. Force stoping throwing +/obj/structure/coatrack/Bumped(atom/movable/moving_atom) + ..() + + if (coat) + return + + for (var/T in allowed) + if (!istype(moving_atom, T)) + continue + visible_message("[moving_atom] lands on \the [src].") + moving_atom.forceMove(src) + coat = moving_atom + update_icon() + return + /obj/structure/coatrack/update_icon() overlays.Cut() if(istype(coat, /obj/item/clothing/suit/storage/labcoat))