diff --git a/code/_onclick/drag_drop.dm b/code/_onclick/drag_drop.dm index fffbbc059f..a864ff48ce 100644 --- a/code/_onclick/drag_drop.dm +++ b/code/_onclick/drag_drop.dm @@ -91,6 +91,20 @@ /atom/movable/screen/click_catcher/IsAutoclickable() . = 1 +//Please don't roast me too hard +/client/MouseMove(object, location, control, params) + mouseParams = params + mouse_location_ref = WEAKREF(location) + mouse_object_ref = WEAKREF(object) + middle_drag_atom_ref = WEAKREF(control) + if(mob) + SEND_SIGNAL(mob, COMSIG_MOB_CLIENT_MOUSEMOVE, object, location, control, params) + // god forgive me for i have sinned - used for autoparry. currently at 5 objects. + moused_over_objects[object] = world.time + if(moused_over_objects.len > 7) + moused_over_objects.Cut(1, 2) + ..() + /client/MouseDrag(src_object,atom/over_object,src_location,over_location,src_control,over_control,params) var/list/modifiers = params2list(params) if (LAZYACCESS(modifiers, MIDDLE_CLICK)) diff --git a/code/game/objects/structures/manned_turret.dm b/code/game/objects/structures/manned_turret.dm index 639180356d..5fce5a9175 100644 --- a/code/game/objects/structures/manned_turret.dm +++ b/code/game/objects/structures/manned_turret.dm @@ -80,7 +80,7 @@ return FALSE var/client/C = controller.client if(C) - var/atom/A = WEAKREF(C.mouse_object_ref) + var/atom/A = C.mouse_object_ref?.resolve() var/turf/T = get_turf(A) if(istype(T)) //They're hovering over something in the map. direction_track(controller, T) diff --git a/code/modules/keybindings/keybind/mob.dm b/code/modules/keybindings/keybind/mob.dm index d5b8eb1a38..1599073154 100644 --- a/code/modules/keybindings/keybind/mob.dm +++ b/code/modules/keybindings/keybind/mob.dm @@ -85,6 +85,6 @@ description = "Immediately examine anything you're hovering your mouse over." /datum/keybinding/mob/examine_immediate/down(client/user) - var/atom/A = WEAKREF(user.mouse_object_ref) + var/atom/A = user.mouse_object_ref?.resolve() if(A) A.attempt_examinate(user.mob) diff --git a/code/modules/mob/living/living_active_parry.dm b/code/modules/mob/living/living_active_parry.dm index dacfe3a863..7dcc812863 100644 --- a/code/modules/mob/living/living_active_parry.dm +++ b/code/modules/mob/living/living_active_parry.dm @@ -241,7 +241,7 @@ // before doing anything, check if the user moused over them properly if(!client) return BLOCK_NONE - var/found = attacker == WEAKREF(client.mouse_object_ref) + var/found = attacker == client.mouse_object_ref?.resolve() if(!found) for(var/i in client.moused_over_objects) if(i == object)