This commit is contained in:
silicons
2020-07-20 10:13:50 -07:00
parent ae83a6df02
commit 6ab250dd03
6 changed files with 71 additions and 23 deletions
+1 -1
View File
@@ -70,7 +70,7 @@
CtrlClickOn(A)
return
if(world.time <= next_move)
if(!CheckActionCooldown(immediate = TRUE))
return
if(aicamera.in_camera_mode)
+18 -9
View File
@@ -10,7 +10,7 @@
/atom/Click(location,control,params)
if(flags_1 & INITIALIZED_1)
SEND_SIGNAL(src, COMSIG_CLICK, location, control, params, usr)
usr.ClickOn(src, params)
usr.CommonClickOn(src, params)
/atom/DblClick(location,control,params)
if(flags_1 & INITIALIZED_1)
@@ -20,6 +20,21 @@
if(flags_1 & INITIALIZED_1)
usr.MouseWheelOn(src, delta_x, delta_y, params)
/**
* Common mob click code
*/
/mob/proc/CommonClickOn(atom/A, params)
set waitfor = FALSE // oh no you don't
if(mob_transforming)
return
if(SEND_SIGNAL(src, COMSIG_MOB_CLICKON, A, params) & COMSIG_MOB_CANCEL_CLICKON)
return
if(ClickOn(A, params))
FlushLastAction()
else
DiscardLastAction()
/*
Standard mob ClickOn()
Handles exceptions: Buildmode, middle click, modified clicks, mech actions
@@ -37,12 +52,6 @@
if(check_click_intercept(params,A))
return
if(mob_transforming)
return
if(SEND_SIGNAL(src, COMSIG_MOB_CLICKON, A, params) & COMSIG_MOB_CANCEL_CLICKON)
return
var/list/modifiers = params2list(params)
if(modifiers["shift"] && modifiers["middle"])
ShiftMiddleClickOn(A)
@@ -72,7 +81,7 @@
face_atom(A)
if(!CheckActionCooldown())
if(!CheckActionCooldown(immediate = TRUE))
return
if(!modifiers["catcher"] && A.IsObscured())
@@ -85,7 +94,7 @@
if(restrained())
DelayNextAction(CLICK_CD_HANDCUFFED)
RestrainedClickOn(A)
return
return TRUE
if(in_throw_mode)
throw_item(A)
+1 -1
View File
@@ -33,7 +33,7 @@
CtrlClickOn(A)
return
if(!CheckActionCooldown())
if(!CheckActionCooldown(immediate = TRUE))
return
face_atom(A) // change direction to face what you clicked on