[MIRROR] Fixes some potential sleeps as detected by SpacemanDMM improvements (#1216)

* Fix some potential sleeps as detected by SpacemanDMM improvements (#54230)

overrides weren't detected by should not sleep, i think i've mostly
fixed that with SpaceManiac/SpacemanDMM#214

Some of these are wacky but overall this pr is harmless

signals shouldnt sleep even in weird 1 in a million situations or due
to other people adding bad code

overrides of changeling can_sting() use alert() and input() and that's
just too fucked for me to fix in this pr

* Fixes some potential sleeps as detected by SpacemanDMM improvements

Co-authored-by: spookydonut <github@spooksoftware.com>
This commit is contained in:
SkyratBot
2020-10-09 18:28:59 +02:00
committed by GitHub
co-authored by spookydonut
parent a76adbfbb6
commit 7eeaefe645
28 changed files with 111 additions and 95 deletions
@@ -3,6 +3,9 @@
var/modifier = 0
/datum/chemical_reaction/reagent_explosion/on_reaction(datum/reagents/holder, created_volume)
explode(holder, created_volume)
/datum/chemical_reaction/reagent_explosion/proc/explode(datum/reagents/holder, created_volume)
var/power = modifier + round(created_volume/strengthdiv, 1)
if(power > 0)
var/turf/T = get_turf(holder.my_atom)
@@ -23,7 +26,6 @@
e.start()
holder.clear_reagents()
/datum/chemical_reaction/reagent_explosion/nitroglycerin
results = list(/datum/reagent/nitroglycerin = 2)
required_reagents = list(/datum/reagent/glycerol = 1, /datum/reagent/toxin/acid/nitracid = 1, /datum/reagent/toxin/acid = 1)
@@ -146,15 +148,16 @@
R.stun(20)
R.reveal(100)
R.adjustHealth(50)
sleep(20)
for(var/mob/living/carbon/C in get_hearers_in_view(round(created_volume/48,1),get_turf(holder.my_atom)))
if(iscultist(C))
to_chat(C, "<span class='userdanger'>The divine explosion sears you!</span>")
C.Paralyze(40)
C.adjust_fire_stacks(5)
C.IgniteMob()
addtimer(CALLBACK(src, .proc/divine_explosion, round(created_volume/48,1),get_turf(holder.my_atom)), 2 SECONDS)
..()
/datum/chemical_reaction/reagent_explosion/potassium_explosion/holyboom/proc/divine_explosion(size, turf/T)
for(var/mob/living/carbon/C in get_hearers_in_view(size,T))
if(iscultist(C))
to_chat(C, "<span class='userdanger'>The divine explosion sears you!</span>")
C.Paralyze(40)
C.adjust_fire_stacks(5)
C.IgniteMob()
/datum/chemical_reaction/gunpowder
results = list(/datum/reagent/gunpowder = 3)
@@ -168,8 +171,7 @@
mix_message = "<span class='boldannounce'>Sparks start flying around the gunpowder!</span>"
/datum/chemical_reaction/reagent_explosion/gunpowder_explosion/on_reaction(datum/reagents/holder, created_volume)
sleep(rand(50,100))
..()
addtimer(CALLBACK(src, .proc/explode, holder, created_volume), rand(5,10) SECONDS)
/datum/chemical_reaction/thermite
results = list(/datum/reagent/thermite = 3)
@@ -452,19 +454,22 @@
var/T1 = created_volume * 20 //100 units : Zap 3 times, with powers 2000/5000/12000. Tesla revolvers have a power of 10000 for comparison.
var/T2 = created_volume * 50
var/T3 = created_volume * 120
sleep(5)
var/added_delay = 0.5 SECONDS
if(created_volume >= 75)
tesla_zap(holder.my_atom, 7, T1, zap_flags)
playsound(holder.my_atom, 'sound/machines/defib_zap.ogg', 50, TRUE)
sleep(15)
addtimer(CALLBACK(src, .proc/zappy_zappy, holder, T1), added_delay)
added_delay += 1.5 SECONDS
if(created_volume >= 40)
tesla_zap(holder.my_atom, 7, T2, zap_flags)
playsound(holder.my_atom, 'sound/machines/defib_zap.ogg', 50, TRUE)
sleep(15)
addtimer(CALLBACK(src, .proc/zappy_zappy, holder, T2), added_delay)
added_delay += 1.5 SECONDS
if(created_volume >= 10) //10 units minimum for lightning, 40 units for secondary blast, 75 units for tertiary blast.
tesla_zap(holder.my_atom, 7, T3, zap_flags)
playsound(holder.my_atom, 'sound/machines/defib_zap.ogg', 50, TRUE)
..()
addtimer(CALLBACK(src, .proc/zappy_zappy, holder, T3), added_delay)
addtimer(CALLBACK(src, .proc/explode, holder, created_volume), added_delay)
/datum/chemical_reaction/reagent_explosion/teslium_lightning/proc/zappy_zappy(datum/reagents/holder, power)
if(QDELETED(holder.my_atom))
return
tesla_zap(holder.my_atom, 7, power, zap_flags)
playsound(holder.my_atom, 'sound/machines/defib_zap.ogg', 50, TRUE)
/datum/chemical_reaction/reagent_explosion/teslium_lightning/heat
required_temp = 474
@@ -3,6 +3,9 @@
var/deletes_extract = TRUE
/datum/chemical_reaction/slime/on_reaction(datum/reagents/holder)
use_slime_core(holder)
/datum/chemical_reaction/slime/proc/use_slime_core(datum/reagents/holder)
SSblackbox.record_feedback("tally", "slime_cores_used", 1, "type")
if(deletes_extract)
delete_extract(holder)
@@ -484,7 +487,9 @@
required_other = TRUE
/datum/chemical_reaction/slime/slimestop/on_reaction(datum/reagents/holder)
sleep(50)
addtimer(CALLBACK(src, .proc/slime_stop, holder), 5 SECONDS)
/datum/chemical_reaction/slime/slimestop/proc/slime_stop(datum/reagents/holder)
var/obj/item/slime_extract/sepia/extract = holder.my_atom
var/turf/T = get_turf(holder.my_atom)
new /obj/effect/timestop(T, null, null, null)
@@ -493,8 +498,7 @@
var/mob/lastheld = get_mob_by_key(holder.my_atom.fingerprintslast)
if(lastheld && !lastheld.equip_to_slot_if_possible(extract, ITEM_SLOT_HANDS, disable_warning = TRUE))
extract.forceMove(get_turf(lastheld))
..()
use_slime_core(holder)
/datum/chemical_reaction/slime/slimecamera
required_reagents = list(/datum/reagent/water = 1)