mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
[MIRROR] Removes SIGNAL_HANDLER_DOES_SLEEP and makes signals synchronous (#5845)
* Removes SIGNAL_HANDLER_DOES_SLEEP and makes signals synchronous (#59176) * Removes SIGNAL_HANDLER_DOES_SLEEP and makes signals synchronous * a * Update peacekeeper_clothing.dm * Update peacekeeper_clothing.dm * Update peacekeeper_clothing.dm Co-authored-by: Kylerace <kylerlumpkin1@gmail.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
co-authored by
Kylerace
Gandalf
parent
07a719c2e3
commit
22a553a0c4
@@ -316,14 +316,14 @@
|
||||
if(!(C.datum_flags & DF_SIGNAL_ENABLED))
|
||||
return NONE
|
||||
var/proctype = C.signal_procs[src][sigtype]
|
||||
return NONE | CallAsync(C, proctype, arguments)
|
||||
return NONE | call(C, proctype)(arglist(arguments))
|
||||
. = NONE
|
||||
for(var/I in target)
|
||||
var/datum/C = I
|
||||
if(!(C.datum_flags & DF_SIGNAL_ENABLED))
|
||||
continue
|
||||
var/proctype = C.signal_procs[src][sigtype]
|
||||
. |= CallAsync(C, proctype, arguments)
|
||||
. |= call(C, proctype)(arglist(arguments))
|
||||
|
||||
// The type arg is casted so initial works, you shouldn't be passing a real instance into this
|
||||
/**
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
update_parent(index)
|
||||
|
||||
/datum/component/construction/proc/action(datum/source, obj/item/I, mob/living/user)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
SIGNAL_HANDLER
|
||||
|
||||
return check_step(I, user)
|
||||
return INVOKE_ASYNC(src, .proc/check_step, I, user)
|
||||
|
||||
/datum/component/construction/proc/update_index(diff)
|
||||
index += diff
|
||||
|
||||
@@ -185,12 +185,16 @@
|
||||
|
||||
/// Called when a carbon with an object embedded/stuck to them inspects themselves and clicks the appropriate link to begin ripping the item out. This handles the ripping attempt, descriptors, and dealing damage, then calls safe_remove()
|
||||
/datum/component/embedded/proc/ripOut(datum/source, obj/item/I, obj/item/bodypart/limb)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(I != weapon || src.limb != limb)
|
||||
return
|
||||
var/mob/living/carbon/victim = parent
|
||||
var/time_taken = rip_time * weapon.w_class
|
||||
INVOKE_ASYNC(src, .proc/complete_rip_out, victim, I, limb, time_taken)
|
||||
|
||||
/// everything async that ripOut used to do
|
||||
/datum/component/embedded/proc/complete_rip_out(mob/living/carbon/victim, obj/item/I, obj/item/bodypart/limb, time_taken)
|
||||
victim.visible_message("<span class='warning'>[victim] attempts to remove [weapon] from [victim.p_their()] [limb.name].</span>","<span class='notice'>You attempt to remove [weapon] from your [limb.name]... (It will take [DisplayTimeText(time_taken)].)</span>")
|
||||
if(!do_after(victim, time_taken, target = victim))
|
||||
return
|
||||
|
||||
@@ -117,8 +117,10 @@
|
||||
|
||||
///Bang bang, we're firing a charged shot off
|
||||
/datum/component/gunpoint/proc/trigger_reaction()
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
SIGNAL_HANDLER
|
||||
INVOKE_ASYNC(src, .proc/async_trigger_reaction)
|
||||
|
||||
/datum/component/gunpoint/proc/async_trigger_reaction()
|
||||
var/mob/living/shooter = parent
|
||||
shooter.remove_status_effect(STATUS_EFFECT_HOLDUP) // try doing these before the trigger gets pulled since the target (or shooter even) may not exist after pulling the trigger, dig?
|
||||
target.remove_status_effect(STATUS_EFFECT_HELDUP, shooter)
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
* We do the prob() at the beginning to A. add some tension for /when/ it will strike, and B. (more importantly) ameliorate the fact that we're checking up to 5 turfs's contents each time
|
||||
*/
|
||||
/datum/component/omen/proc/check_accident(atom/movable/our_guy)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!isliving(our_guy))
|
||||
return
|
||||
@@ -66,7 +66,7 @@
|
||||
to_chat(living_guy, "<span class='warning'>A malevolent force launches your body to the floor...</span>")
|
||||
var/obj/machinery/door/airlock/darth_airlock = turf_content
|
||||
living_guy.apply_status_effect(STATUS_EFFECT_PARALYZED, 10)
|
||||
darth_airlock.close(force_crush = TRUE)
|
||||
INVOKE_ASYNC(darth_airlock, /obj/machinery/door/airlock.proc/close, TRUE)
|
||||
if(!permanent)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -84,7 +84,7 @@
|
||||
for(var/obj/machinery/vending/darth_vendor in the_turf)
|
||||
if(darth_vendor.tiltable)
|
||||
to_chat(living_guy, "<span class='warning'>A malevolent force tugs at the [darth_vendor]...</span>")
|
||||
darth_vendor.tilt(living_guy)
|
||||
INVOKE_ASYNC(darth_vendor, /obj/machinery/vending.proc/tilt, living_guy)
|
||||
if(!permanent)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -8,11 +8,6 @@
|
||||
var/obj/item/storage/wallet/A = parent
|
||||
if(istype(A) && A.front_id && !issilicon(user) && !(A.item_flags & IN_STORAGE)) //if it's a wallet in storage seeing the full inventory is more useful
|
||||
var/obj/item/I = A.front_id
|
||||
A.add_fingerprint(user)
|
||||
remove_from_storage(I, get_turf(user))
|
||||
if(!user.put_in_hands(I))
|
||||
to_chat(user, "<span class='notice'>You fumble for [I] and it falls on the floor.</span>")
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] draws [I] from [parent]!</span>", "<span class='notice'>You draw [I] from [parent].</span>")
|
||||
INVOKE_ASYNC(src, .proc/attempt_put_in_hands, I, user)
|
||||
return
|
||||
..()
|
||||
return ..()
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
INVOKE_ASYNC(src, .proc/quick_empty, M)
|
||||
|
||||
/datum/component/storage/proc/preattack_intercept(datum/source, obj/O, mob/M, params)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!isitem(O) || !click_gather || SEND_SIGNAL(O, COMSIG_CONTAINS_STORAGE))
|
||||
return FALSE
|
||||
@@ -209,19 +209,23 @@
|
||||
return
|
||||
if(!isturf(I.loc))
|
||||
return
|
||||
var/list/things = I.loc.contents.Copy()
|
||||
INVOKE_ASYNC(src, .proc/async_preattack_intercept, I, M)
|
||||
|
||||
///async functionality from preattack_intercept
|
||||
/datum/component/storage/proc/async_preattack_intercept(obj/item/attack_item, mob/pre_attack_mob)
|
||||
var/list/things = attack_item.loc.contents.Copy()
|
||||
if(collection_mode == COLLECT_SAME)
|
||||
things = typecache_filter_list(things, typecacheof(I.type))
|
||||
things = typecache_filter_list(things, typecacheof(attack_item.type))
|
||||
var/len = length(things)
|
||||
if(!len)
|
||||
to_chat(M, "<span class='warning'>You failed to pick up anything with [parent]!</span>")
|
||||
to_chat(pre_attack_mob, "<span class='warning'>You failed to pick up anything with [parent]!</span>")
|
||||
return
|
||||
var/datum/progressbar/progress = new(M, len, I.loc)
|
||||
var/datum/progressbar/progress = new(pre_attack_mob, len, attack_item.loc)
|
||||
var/list/rejections = list()
|
||||
while(do_after(M, 1 SECONDS, parent, NONE, FALSE, CALLBACK(src, .proc/handle_mass_pickup, things, I.loc, rejections, progress)))
|
||||
while(do_after(pre_attack_mob, 1 SECONDS, parent, NONE, FALSE, CALLBACK(src, .proc/handle_mass_pickup, things, attack_item.loc, rejections, progress)))
|
||||
stoplag(1)
|
||||
progress.end_progress()
|
||||
to_chat(M, "<span class='notice'>You put everything you could [insert_preposition] [parent].</span>")
|
||||
to_chat(pre_attack_mob, "<span class='notice'>You put everything you could [insert_preposition] [parent].</span>")
|
||||
|
||||
/datum/component/storage/proc/handle_mass_item_insertion(list/things, datum/component/storage/src_object, mob/user, datum/progressbar/progress)
|
||||
var/atom/source_real_location = src_object.real_location()
|
||||
@@ -758,7 +762,7 @@
|
||||
return max(0, max_items - real_location.contents.len)
|
||||
|
||||
/datum/component/storage/proc/signal_fill_type(datum/source, type, amount = 20, force = FALSE)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
SIGNAL_HANDLER
|
||||
|
||||
var/atom/real_location = real_location()
|
||||
if(!force)
|
||||
@@ -766,9 +770,8 @@
|
||||
for(var/i in 1 to amount)
|
||||
if(!handle_item_insertion(new type(real_location), TRUE))
|
||||
return i > 1 //return TRUE only if at least one insertion has been successful.
|
||||
if(CHECK_TICK)
|
||||
if(QDELETED(src))
|
||||
return TRUE
|
||||
if(QDELETED(src))
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -833,7 +836,7 @@
|
||||
return hide_from(target)
|
||||
|
||||
/datum/component/storage/proc/on_alt_click(datum/source, mob/user)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!isliving(user) || !user.CanReach(parent) || user.incapacitated())
|
||||
return
|
||||
@@ -849,15 +852,22 @@
|
||||
A.do_jiggle() //SKYRAT EDIT ADDITION - AESTHETICS
|
||||
return
|
||||
|
||||
var/obj/item/I = locate() in real_location()
|
||||
if(!I)
|
||||
var/obj/item/to_remove = locate() in real_location()
|
||||
if(!to_remove)
|
||||
return
|
||||
A.add_fingerprint(user)
|
||||
remove_from_storage(I, get_turf(user))
|
||||
if(!user.put_in_hands(I))
|
||||
to_chat(user, "<span class='notice'>You fumble for [I] and it falls on the floor.</span>")
|
||||
|
||||
INVOKE_ASYNC(src, .proc/attempt_put_in_hands, to_remove, user)
|
||||
|
||||
///attempt to put an item from contents into the users hands
|
||||
/datum/component/storage/proc/attempt_put_in_hands(obj/item/to_remove, mob/user)
|
||||
var/atom/parent_as_atom = parent
|
||||
|
||||
parent_as_atom.add_fingerprint(user)
|
||||
remove_from_storage(to_remove, get_turf(user))
|
||||
if(!user.put_in_hands(to_remove))
|
||||
to_chat(user, "<span class='notice'>You fumble for [to_remove] and it falls on the floor.</span>")
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] draws [I] from [parent]!</span>", "<span class='notice'>You draw [I] from [parent].</span>")
|
||||
user.visible_message("<span class='warning'>[user] draws [to_remove] from [parent]!</span>", "<span class='notice'>You draw [to_remove] from [parent].</span>")
|
||||
|
||||
/datum/component/storage/proc/action_trigger(datum/signal_source, datum/action/source)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
* Finally, we return a bitflag to [COMSIG_MOVABLE_IMPACT] that forces the hitpush to false so that we don't knock them away.
|
||||
*/
|
||||
/datum/component/tackler/proc/sack(mob/living/carbon/user, atom/hit)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!tackling || !tackle)
|
||||
return
|
||||
@@ -149,7 +149,7 @@
|
||||
user.toggle_throw_mode()
|
||||
if(!iscarbon(hit))
|
||||
if(hit.density)
|
||||
return splat(user, hit)
|
||||
INVOKE_ASYNC(src, .proc/splat, user, hit)
|
||||
return
|
||||
|
||||
var/mob/living/carbon/target = hit
|
||||
@@ -210,7 +210,7 @@
|
||||
target.Paralyze(5)
|
||||
target.Knockdown(30)
|
||||
if(ishuman(target) && ishuman(user))
|
||||
S.dna.species.grab(S, T)
|
||||
INVOKE_ASYNC(S.dna.species, /datum/species.proc/grab, S, T)
|
||||
S.setGrabState(GRAB_PASSIVE)
|
||||
|
||||
if(5 to INFINITY) // absolutely BODIED
|
||||
@@ -224,7 +224,7 @@
|
||||
target.Paralyze(5)
|
||||
target.Knockdown(30)
|
||||
if(ishuman(target) && ishuman(user))
|
||||
S.dna.species.grab(S, T)
|
||||
INVOKE_ASYNC(S.dna.species, /datum/species.proc/grab, S, T)
|
||||
S.setGrabState(GRAB_AGGRESSIVE)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user