Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bugs with designator usage #4693

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
#define COMSIG_HUMAN_UPDATE_SIGHT "human_update_sight"
#define COMPONENT_OVERRIDE_UPDATE_SIGHT (1<<0)

///from /mob/living/carbon/human/movement_delay()
#define COMSIG_HUMAN_MOVEMENT_CANCEL_INTERACTION "human_movement_cancel_interaction"
#define COMPONENT_HUMAN_MOVEMENT_KEEP_USING (1<<0)

///from /mob/living/carbon/human/update_sight()
#define COMSIG_HUMAN_POST_UPDATE_SIGHT "human_post_update_sight"
///from /mob/living/carbon/human/movement_delay(): (list/movedata)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ cases. Override_icon_state should be a list.*/
unzoom(user)

/obj/item/proc/unzoom(mob/living/user)
if(user.interactee == src)
user.unset_interaction()
var/zoom_device = zoomdevicename ? "\improper [zoomdevicename] of [src]" : "\improper [src]"
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]."))
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/items/devices/binoculars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@

/obj/item/device/binoculars/on_set_interaction(mob/user)
flags_atom |= RELAY_CLICK

RegisterSignal(user, COMSIG_HUMAN_MOVEMENT_CANCEL_INTERACTION, PROC_REF(interaction_handler))

/obj/item/device/binoculars/on_unset_interaction(mob/user)
flags_atom &= ~RELAY_CLICK
UnregisterSignal(user, COMSIG_HUMAN_MOVEMENT_CANCEL_INTERACTION)

/obj/item/device/binoculars/proc/interaction_handler()
return COMPONENT_HUMAN_MOVEMENT_KEEP_USING

/obj/item/device/binoculars/civ
desc = "A pair of binoculars."
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
recalculate_move_delay = FALSE

if(interactee)// moving stops any kind of interaction
unset_interaction()
if(!(SEND_SIGNAL(src, COMSIG_HUMAN_MOVEMENT_CANCEL_INTERACTION) & COMPONENT_HUMAN_MOVEMENT_KEEP_USING))
unset_interaction()

if(species.slowdown)
. += species.slowdown
Expand Down
Loading