okay so this is necessary

This commit is contained in:
SandPoot
2024-01-05 22:09:21 -03:00
parent 00b30e0672
commit 6d7321b0c4
4 changed files with 17 additions and 3 deletions
+14
View File
@@ -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))
@@ -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)
+1 -1
View File
@@ -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)
@@ -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)