Merge pull request #14028 from SteelSlayer/spawn-removal

Some spawn removals and other assorted code cleanup
This commit is contained in:
variableundefined
2020-09-16 11:47:59 -04:00
committed by GitHub
23 changed files with 92 additions and 143 deletions
+1 -1
View File
@@ -25,5 +25,5 @@
for(var/thing in epicentreList)
var/obj/effect/landmark/epicentre = thing
for(var/obj/machinery/power/apc/apc in range(epicentre, lightsoutRange))
apc.overload_lighting()
INVOKE_ASYNC(apc, /obj/machinery/power/apc.proc/overload_lighting)
+9 -10
View File
@@ -34,16 +34,15 @@
/obj/item/reagent_containers/food/snacks/proc/On_Consume(mob/M, mob/user)
if(!user)
return
spawn(0)
if(!reagents.total_volume)
if(M == user)
to_chat(user, "<span class='notice'>You finish eating \the [src].</span>")
user.visible_message("<span class='notice'>[M] finishes eating \the [src].</span>")
user.unEquip(src) //so icons update :[
Post_Consume(M)
var/obj/item/trash_item = generate_trash(usr)
usr.put_in_hands(trash_item)
qdel(src)
if(!reagents.total_volume)
if(M == user)
to_chat(user, "<span class='notice'>You finish eating \the [src].</span>")
user.visible_message("<span class='notice'>[M] finishes eating \the [src].</span>")
user.unEquip(src) //so icons update :[
Post_Consume(M)
var/obj/item/trash_item = generate_trash(usr)
usr.put_in_hands(trash_item)
qdel(src)
return
/obj/item/reagent_containers/food/snacks/proc/Post_Consume(mob/living/M)
+6 -16
View File
@@ -38,8 +38,7 @@
O.rename_self("AI",1)
spawn()
qdel(src)
INVOKE_ASYNC(GLOBAL_PROC, .proc/qdel, src) // To prevent the proc from returning null.
return O
@@ -102,8 +101,7 @@
O.Namepick()
spawn(0)//To prevent the proc from returning null.
qdel(src)
INVOKE_ASYNC(GLOBAL_PROC, .proc/qdel, src) // To prevent the proc from returning null.
return O
//human -> alien
@@ -135,9 +133,7 @@
to_chat(new_xeno, "<B>You are now an alien.</B>")
new_xeno.update_pipe_vision()
spawn(0)//To prevent the proc from returning null.
qdel(src)
return
qdel(src)
/mob/living/carbon/human/proc/slimeize(reproduce as num)
if(notransform)
@@ -190,9 +186,7 @@
to_chat(new_corgi, "<B>You are now a Corgi. Yap Yap!</B>")
new_corgi.update_pipe_vision()
spawn(0)//To prevent the proc from returning null.
qdel(src)
return
qdel(src)
/mob/living/carbon/human/Animalize()
@@ -221,9 +215,7 @@
to_chat(new_mob, "You suddenly feel more... animalistic.")
new_mob.update_pipe_vision()
spawn()
qdel(src)
return
qdel(src)
/mob/proc/Animalize()
@@ -264,9 +256,7 @@
to_chat(pai, "<B>You have become a pAI! Your name is [pai.name].</B>")
pai.update_pipe_vision()
spawn(0)//To prevent the proc from returning null.
qdel(src)
return
qdel(src)
/mob/proc/safe_respawn(var/MP)
if(!MP)
+14 -26
View File
@@ -70,26 +70,22 @@
switch(href_list["op"])
if("control")
active = locate(href_list["bot"])
spawn(0)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
if("scanbots") // find all bots
botlist = null
spawn(0)
post_signal(control_freq, "command", "bot_status", s_filter = bot_filter)
post_signal(control_freq, "command", "bot_status", s_filter = bot_filter)
if("botlist")
active = null
if("stop", "go", "home")
spawn(0)
post_signal(control_freq, "command", href_list["op"], "active", active, s_filter = bot_filter)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
post_signal(control_freq, "command", href_list["op"], "active", active, s_filter = bot_filter)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
if("summon")
spawn(0)
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(hostpda), "useraccess", hostpda.GetAccess(), "user", usr, s_filter = bot_filter)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(hostpda), "useraccess", hostpda.GetAccess(), "user", usr, s_filter = bot_filter)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
/obj/item/integrated_radio/proc/add_to_radio(bot_filter) //Master filter control for bots. Must be placed in the bot's local New() to support map spawned bots.
if(SSradio)
@@ -123,38 +119,30 @@
..()
switch(href_list["op"])
if("start")
spawn(0)
post_signal(control_freq, "command", "start", "active", active, s_filter = RADIO_MULEBOT)
post_signal(control_freq, "command", "start", "active", active, s_filter = RADIO_MULEBOT)
if("unload")
spawn(0)
post_signal(control_freq, "command", "unload", "active", active, s_filter = RADIO_MULEBOT)
post_signal(control_freq, "command", "unload", "active", active, s_filter = RADIO_MULEBOT)
if("setdest")
if(GLOB.deliverybeacons)
var/dest = input("Select Bot Destination", "Mulebot [active.suffix] Interlink", active.destination) as null|anything in GLOB.deliverybeacontags
if(dest)
spawn(0)
post_signal(control_freq, "command", "target", "active", active, "destination", dest, s_filter = RADIO_MULEBOT)
post_signal(control_freq, "command", "target", "active", active, "destination", dest, s_filter = RADIO_MULEBOT)
if("retoff")
spawn(0)
post_signal(control_freq, "command", "autoret", "active", active, "value", 0, s_filter = RADIO_MULEBOT)
post_signal(control_freq, "command", "autoret", "active", active, "value", 0, s_filter = RADIO_MULEBOT)
if("reton")
spawn(0)
post_signal(control_freq, "command", "autoret", "active", active, "value", 1, s_filter = RADIO_MULEBOT)
post_signal(control_freq, "command", "autoret", "active", active, "value", 1, s_filter = RADIO_MULEBOT)
if("pickoff")
spawn(0)
post_signal(control_freq, "command", "autopick", "active", active, "value", 0, s_filter = RADIO_MULEBOT)
post_signal(control_freq, "command", "autopick", "active", active, "value", 0, s_filter = RADIO_MULEBOT)
if("pickon")
spawn(0)
post_signal(control_freq, "command", "autopick", "active", active, "value", 1, s_filter = RADIO_MULEBOT)
post_signal(control_freq, "command", "autopick", "active", active, "value", 1, s_filter = RADIO_MULEBOT)
spawn(10)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_MULEBOT)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_MULEBOT)
+5 -6
View File
@@ -940,7 +940,7 @@
update()
if("overload")
if(usr.has_unlimited_silicon_privilege)
overload_lighting()
INVOKE_ASYNC(src, /obj/machinery/power/apc.proc/overload_lighting)
if("hack")
if(get_malf_status(usr))
malfhack(usr)
@@ -1287,11 +1287,10 @@
return
if(cell && cell.charge >= 20)
cell.use(20)
spawn(0)
for(var/obj/machinery/light/L in area)
if(prob(chance))
L.break_light_tube(0, 1)
stoplag()
for(var/obj/machinery/light/L in area)
if(prob(chance))
L.break_light_tube(0, 1)
stoplag()
/obj/machinery/power/apc/proc/null_charge()
for(var/obj/machinery/light/L in area)
@@ -163,8 +163,7 @@
/datum/chemical_reaction/blackpowder_explosion/on_reaction(datum/reagents/holder, created_volume)
var/location = get_turf(holder.my_atom)
do_sparks(2, 1, location)
spawn(rand(5, 15))
blackpowder_detonate(holder, created_volume)
addtimer(CALLBACK(null, .proc/blackpowder_detonate, holder, created_volume), rand(5, 15))
/proc/blackpowder_detonate(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
@@ -175,8 +174,7 @@
explosion(T, ex_severe, ex_heavy,ex_light, ex_flash, 1)
// If this black powder is in a decal, remove the decal, because it just exploded
if(istype(holder.my_atom, /obj/effect/decal/cleanable/dirt/blackpowder))
spawn(0)
qdel(holder.my_atom)
qdel(holder.my_atom)
/datum/chemical_reaction/flash_powder
name = "Flash powder"
@@ -23,13 +23,12 @@
/obj/item/reagent_containers/food/pill/attack(mob/living/carbon/M, mob/user, def_zone)
if(!istype(M))
return 0
return FALSE
bitesize = reagents.total_volume
if(M.eat(src, user))
spawn(0)
qdel(src)
return 1
return 0
qdel(src)
return TRUE
return FALSE
/obj/item/reagent_containers/food/pill/afterattack(obj/target, mob/user, proximity)
if(!proximity)
@@ -44,7 +44,7 @@
return
var/contents_log = reagents.reagent_list.Join(", ")
spray(A)
INVOKE_ASYNC(src, .proc/spray, A)
playsound(loc, 'sound/effects/spray2.ogg', 50, 1, -6)
user.changeNext_move(CLICK_CD_RANGE*2)
@@ -62,19 +62,19 @@
return
/obj/item/reagent_containers/spray/proc/spray(var/atom/A)
/obj/item/reagent_containers/spray/proc/spray(atom/A)
var/obj/effect/decal/chempuff/D = new /obj/effect/decal/chempuff(get_turf(src))
D.create_reagents(amount_per_transfer_from_this)
reagents.trans_to(D, amount_per_transfer_from_this, 1/spray_currentrange)
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
spawn(0)
for(var/i=0, i<spray_currentrange, i++)
step_towards(D,A)
D.reagents.reaction(get_turf(D))
for(var/atom/T in get_turf(D))
D.reagents.reaction(T)
sleep(3)
qdel(D)
for(var/i in 1 to spray_currentrange)
step_towards(D, A)
D.reagents.reaction(get_turf(D))
for(var/atom/T in get_turf(D))
D.reagents.reaction(T)
sleep(3)
qdel(D)
/obj/item/reagent_containers/spray/attack_self(var/mob/user)
+1
View File
@@ -301,6 +301,7 @@
spawn(0)
D.open()
*/ //Leaving this here incase someone decides to port -tg-'s escape shuttle stuff:
// This basically opens a big-ass row of blast doors when the shuttle arrives at centcom
/obj/docking_port/mobile/pod
name = "escape pod"