From 7d7f40ce90ceb25d23bcdb340173c0db1cf798cd Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Sun, 26 Jul 2020 14:56:03 -0700
Subject: [PATCH] fixes
---
code/_onclick/ai.dm | 6 +++---
code/_onclick/click.dm | 3 ++-
code/_onclick/cyborg.dm | 12 +++--------
code/_onclick/other_mobs.dm | 5 +++--
code/game/objects/buckling.dm | 10 +++++++++
code/game/turfs/simulated/floor.dm | 2 +-
.../clockcult/clock_mobs/_eminence.dm | 21 +++++++++++--------
.../antagonists/disease/disease_mob.dm | 17 ++++++++-------
.../revenant/revenant_abilities.dm | 1 +
.../integrated_electronics/core/assemblies.dm | 1 +
.../mob/living/simple_animal/astral.dm | 6 +++++-
code/modules/photography/camera/camera.dm | 2 +-
12 files changed, 52 insertions(+), 34 deletions(-)
diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm
index 0699915859..18aaf66659 100644
--- a/code/_onclick/ai.dm
+++ b/code/_onclick/ai.dm
@@ -75,11 +75,11 @@
if(aicamera.in_camera_mode)
aicamera.camera_mode_off()
- aicamera.captureimage(pixel_turf, usr)
+ INVOKE_ASYNC(aicamera, /obj/item/camera.proc/captureimage, pixel_turf, usr)
return
if(waypoint_mode)
- waypoint_mode = 0
- set_waypoint(A)
+ waypoint_mode = FALSE
+ INVOKE_ASYNC(src, .proc/set_waypoint, A)
return
A.attack_ai(src)
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index 94b161f0d2..042ab3aaee 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -48,7 +48,8 @@
* item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/
-/mob/proc/ClickOn( atom/A, params)
+/mob/proc/ClickOn(atom/A, params)
+ SHOULD_NOT_SLEEP(TRUE)
if(check_click_intercept(params,A))
return
diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm
index 3dc3176205..372fe46046 100644
--- a/code/_onclick/cyborg.dm
+++ b/code/_onclick/cyborg.dm
@@ -7,7 +7,6 @@
*/
/mob/living/silicon/robot/ClickOn(var/atom/A, var/params)
- set waitfor = FALSE
if(check_click_intercept(params,A))
return
@@ -41,7 +40,7 @@
*/
if(aicamera.in_camera_mode) //Cyborg picture taking
aicamera.camera_mode_off()
- aicamera.captureimage(A, usr)
+ INVOKE_ASYNC(aicamera, /obj/item/camera.proc/captureimage, A, usr)
return
var/obj/item/W = get_active_held_item()
@@ -49,13 +48,8 @@
if(!W && A.Adjacent(src) && (isobj(A) || ismob(A)))
var/atom/movable/C = A
if(C.can_buckle && C.has_buckled_mobs())
- if(C.buckled_mobs.len > 1)
- var/unbuckled = input(src, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in C.buckled_mobs
- if(C.user_unbuckle_mob(unbuckled,src))
- return
- else
- if(C.user_unbuckle_mob(C.buckled_mobs[1],src))
- return
+ INVOKE_ASYNC(C, /atom/movable.proc/precise_user_unbuckle_mob, src)
+ return
if(!W && (get_dist(src,A) <= interaction_range))
A.attack_robot(src)
diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm
index 03dc64d5be..362a15005c 100644
--- a/code/_onclick/other_mobs.dm
+++ b/code/_onclick/other_mobs.dm
@@ -16,6 +16,8 @@
to_chat(src, "The damage in your [check_arm.name] is preventing you from using it! Get it fixed, or at least splinted!")
return
+ . = NONE
+
// Special glove functions:
// If the gloves do anything, have them return 1 to stop
// normal attack_hand() here.
@@ -25,8 +27,6 @@
if(. & INTERRUPT_UNARMED_ATTACK)
return
- . = NONE
-
for(var/datum/mutation/human/HM in dna.mutations)
. |= HM.on_attack_hand(A, proximity, intent, flags)
@@ -37,6 +37,7 @@
return . | A.attack_hand(src, intent, flags)
/atom/proc/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
+ SHOULD_NOT_SLEEP(TRUE)
if(!(interaction_flags_atom & INTERACT_ATOM_NO_FINGERPRINT_ATTACK_HAND))
add_fingerprint(user)
if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, user) & COMPONENT_NO_ATTACK_HAND)
diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm
index 36e7496bd3..bdb748925c 100644
--- a/code/game/objects/buckling.dm
+++ b/code/game/objects/buckling.dm
@@ -145,3 +145,13 @@
var/mob/living/L = M.pulledby
L.set_pull_offsets(M, L.grab_state)
return M
+
+/atom/movable/proc/precise_user_unbuckle_mob(mob/user)
+ if(!buckled_mobs)
+ return
+ else if(length(buckled_mobs) == 1)
+ return user_unbuckle_mob(buckled_mobs[1], user)
+ else
+ var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in buckled_mobs
+ return user_unbuckle_mob(unbuckled, user)
+
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index bdca384bd0..758f824727 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -162,7 +162,7 @@
return 0
/turf/open/floor/crowbar_act(mob/living/user, obj/item/I)
- return intact ? pry_tile(I, user) : FALSE
+ return intact ? FORCE_BOOLEAN(pry_tile(I, user)) : FALSE
/turf/open/floor/proc/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
if(T.turf_type == type)
diff --git a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm
index faa5e025ca..2f6a018a4c 100644
--- a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm
+++ b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm
@@ -114,24 +114,27 @@
superheat_wall(A)
return
if(modifiers["middle"] || modifiers["ctrl"])
- issue_command(A)
+ INVOKE_ASYNC(src, .proc/issue_command, A)
return
if(GLOB.ark_of_the_clockwork_justiciar == A)
var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = GLOB.ark_of_the_clockwork_justiciar
- if(G.recalling)
- return
- if(!G.recalls_remaining)
- to_chat(src, "The Ark can no longer recall!")
- return
- if(alert(src, "Initiate mass recall?", "Mass Recall", "Yes", "No") != "Yes" || QDELETED(src) || QDELETED(G) || !G.obj_integrity)
- return
- G.initiate_mass_recall() //wHOOPS LOOKS LIKE A HULK GOT THROUGH
+ INVOKE_ASYNC(src, .proc/attempt_recall, G)
else if(istype(A, /obj/structure/destructible/clockwork/trap/trigger))
var/obj/structure/destructible/clockwork/trap/trigger/T = A
T.visible_message("[T] clunks as it's activated remotely.")
to_chat(src, "You activate [T].")
T.activate()
+/mob/camera/eminence/proc/attempt_recall(obj/structure/destructible/clockwork/massive/celestial_gateway/G)
+ if(G.recalling)
+ return
+ if(!G.recalls_remaining)
+ to_chat(src, "The Ark can no longer recall!")
+ return
+ if(alert(src, "Initiate mass recall?", "Mass Recall", "Yes", "No") != "Yes" || QDELETED(src) || QDELETED(G) || !G.obj_integrity)
+ return
+ G.initiate_mass_recall() //wHOOPS LOOKS LIKE A HULK GOT THROUGH
+
/mob/camera/eminence/ratvar_act()
name = "\improper Radiance"
real_name = "\improper Radiance"
diff --git a/code/modules/antagonists/disease/disease_mob.dm b/code/modules/antagonists/disease/disease_mob.dm
index e876beb5dc..6a05d07b38 100644
--- a/code/modules/antagonists/disease/disease_mob.dm
+++ b/code/modules/antagonists/disease/disease_mob.dm
@@ -291,16 +291,19 @@ the new instance inside the host to be updated to the template's stats.
/mob/camera/disease/ClickOn(var/atom/A, params)
if(freemove && ishuman(A))
- var/mob/living/carbon/human/H = A
- if(alert(src, "Select [H.name] as your initial host?", "Select Host", "Yes", "No") != "Yes")
- return
- if(!freemove)
- return
- if(QDELETED(H) || !force_infect(H))
- to_chat(src, "[H ? H.name : "Host"] cannot be infected.")
+ confirm_initial_infection(A)
else
..()
+/mob/camera/disease/proc/confirm_initial_infection(mob/living/carbon/human/H)
+ set waitfor = FALSE
+ if(alert(src, "Select [H.name] as your initial host?", "Select Host", "Yes", "No") != "Yes")
+ return
+ if(!freemove)
+ return
+ if(QDELETED(H) || !force_infect(H))
+ to_chat(src, "[H ? H.name : "Host"] cannot be infected.")
+
/mob/camera/disease/proc/adapt_cooldown()
to_chat(src, "You have altered your genetic structure. You will be unable to adapt again for [DisplayTimeText(adaptation_cooldown)].")
next_adaptation_time = world.time + adaptation_cooldown
diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm
index 2d84ed7c22..7a2f661fd9 100644
--- a/code/modules/antagonists/revenant/revenant_abilities.dm
+++ b/code/modules/antagonists/revenant/revenant_abilities.dm
@@ -17,6 +17,7 @@
//Harvest; activated ly clicking the target, will try to drain their essence.
/mob/living/simple_animal/revenant/proc/Harvest(mob/living/carbon/human/target)
+ set waitfor = FALSE
if(!castcheck(0))
return
if(draining)
diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm
index c85e5cc2ca..7c9f811c34 100644
--- a/code/modules/integrated_electronics/core/assemblies.dm
+++ b/code/modules/integrated_electronics/core/assemblies.dm
@@ -519,6 +519,7 @@
/obj/item/electronic_assembly/attack_self(mob/user)
+ set waitfor = FALSE
if(!check_interactivity(user))
return
if(opened)
diff --git a/code/modules/mob/living/simple_animal/astral.dm b/code/modules/mob/living/simple_animal/astral.dm
index eee42c214f..f79a2b5b3e 100644
--- a/code/modules/mob/living/simple_animal/astral.dm
+++ b/code/modules/mob/living/simple_animal/astral.dm
@@ -41,7 +41,11 @@
to_chat(src, "Your astral projection is interrupted and your mind is sent back to your body with a shock!")
/mob/living/simple_animal/astral/ClickOn(var/atom/A, var/params)
- ..()
+ . = ..()
+ attempt_possess(A)
+
+/mob/living/simple_animal/astral/proc/attempt_possess(atom/A)
+ set waitfor = FALSE
if(pseudo_death == FALSE)
if(isliving(A))
if(ishuman(A))
diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm
index 3e76fc874a..b925c67940 100644
--- a/code/modules/photography/camera/camera.dm
+++ b/code/modules/photography/camera/camera.dm
@@ -221,4 +221,4 @@
p.set_picture(picture, TRUE, TRUE)
if(CONFIG_GET(flag/picture_logging_camera))
- picture.log_to_file()
\ No newline at end of file
+ picture.log_to_file()