Skip to content

Commit

Permalink
revert stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
SandPoot committed Jan 16, 2024
1 parent 1dad7e8 commit 17a01b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
17 changes: 2 additions & 15 deletions code/_onclick/drag_drop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
mouseParams = params
mouse_location_ref = WEAKREF(location)
mouse_object_ref = WEAKREF(object)
middle_drag_atom_ref = WEAKREF(control)
mouse_control_object = 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.
Expand All @@ -106,17 +106,10 @@
..()

/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))
if (src_object && src_location != over_location)
middragtime = world.time
middle_drag_atom_ref = WEAKREF(src_object)
else
middragtime = 0
middle_drag_atom_ref = null
mouseParams = params
mouse_location_ref = WEAKREF(over_location)
mouse_object_ref = WEAKREF(over_object)
mouse_control_object = over_control
if(selected_target[1] && over_object?.IsAutoclickable())
selected_target[1] = over_object
selected_target[2] = params
Expand All @@ -127,9 +120,3 @@

/obj/item/proc/onMouseDrag(src_object, over_object, src_location, over_location, params, mob)
return

/client/MouseDrop(atom/src_object, atom/over_object, atom/src_location, atom/over_location, src_control, over_control, params)
if (IS_WEAKREF_OF(src_object, middle_drag_atom_ref))
middragtime = 0
middle_drag_atom_ref = null
..()
5 changes: 1 addition & 4 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@
var/datum/weakref/mouse_location_ref = null
///Used in MouseDrag to preserve the last mouse-entered object. Weakref
var/datum/weakref/mouse_object_ref
//Middle-mouse-button click dragtime control for aimbot exploit detection.
var/middragtime = 0
//Middle-mouse-button clicked object control for aimbot exploit detection. Weakref
var/datum/weakref/middle_drag_atom_ref
var/mouse_control_object

/// Messages currently seen by this client
var/list/seen_messages
Expand Down
12 changes: 1 addition & 11 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -881,18 +881,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
click_intercept_time = 0 //Reset and return. Next click should work, but not this one.
return
click_intercept_time = 0 //Just reset. Let's not keep re-checking forever.
var/ab = FALSE
var/list/modifiers = params2list(params)

var/button_clicked = LAZYACCESS(modifiers, "button")

var/dragged = LAZYACCESS(modifiers, DRAG)
if(dragged && button_clicked != dragged)
if(modifiers[DRAG])
return

if (object && IS_WEAKREF_OF(object, middle_drag_atom_ref) && button_clicked == LEFT_CLICK)
ab = max(0, 5 SECONDS-(world.time-middragtime)*0.1)

var/mcl = CONFIG_GET(number/minute_click_limit)
if (!holder && !ignore_spam && mcl)
var/minute = round(world.time, 600)
Expand All @@ -908,9 +901,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
clicklimiter[ADMINSWARNED_AT] = minute

msg += " Administrators have been informed."
if (ab)
log_game("[key_name(src)] is using the middle click aimbot exploit")
message_admins("[ADMIN_LOOKUPFLW(usr)] [ADMIN_KICK(usr)] is using the middle click aimbot exploit</span>")
log_click(object, location, control, params, src, "lockout (spam - minute)", TRUE)
log_game("[key_name(src)] Has hit the per-minute click limit of [mcl] clicks in a given game minute")
message_admins("[ADMIN_LOOKUPFLW(src)] [ADMIN_KICK(usr)] Has hit the per-minute click limit of [mcl] clicks in a given game minute")
Expand Down

0 comments on commit 17a01b6

Please sign in to comment.