a bunch of async and waitfor

This commit is contained in:
Putnam3145
2021-07-25 19:51:27 -07:00
parent cd2a710a23
commit 95d2adb996
6 changed files with 9 additions and 3 deletions

View File

@@ -163,6 +163,7 @@ Turf and target are separate in case you want to teleport some distance from a t
//Generalised helper proc for letting mobs rename themselves. Used to be clname() and ainame()
/mob/proc/apply_pref_name(role, client/C)
set waitfor = FALSE
if(!C)
C = client
var/oldname = real_name

View File

@@ -173,4 +173,4 @@
if(prob(10))
var/obj/item/clothing/head/helmet/justice/escape/helmet = new(src)
equip_to_slot_or_del(helmet,SLOT_HEAD)
helmet.attack_self(src) // todo encapsulate toggle
INVOKE_ASYNC(helmet, /obj/item.proc/attack_self, src) // todo encapsulate toggle

View File

@@ -381,6 +381,7 @@
..()
/mob/living/simple_animal/pet/dog/corgi/Ian/proc/Read_Memory()
set waitfor = FALSE
if(fexists("data/npc_saves/Ian.sav")) //legacy compatability to convert old format to new
var/savefile/S = new /savefile("data/npc_saves/Ian.sav")
S["age"] >> age

View File

@@ -35,14 +35,16 @@
coffer.Grant(src)
riot = new /datum/action/cooldown/riot
riot.Grant(src)
AddElement(/datum/element/ventcrawling, given_tier = VENTCRAWLER_ALWAYS)
INVOKE_ASYNC(src, .proc/poll_for_player)
/mob/living/simple_animal/hostile/regalrat/poll_for_player()
var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you want to play as the Royal Rat, cheesey be his crown?", ROLE_SENTIENCE, null, FALSE, 100, POLL_IGNORE_SENTIENCE_POTION)
if(LAZYLEN(candidates) && !mind)
var/mob/dead/observer/C = pick(candidates)
key = C.key
notify_ghosts("All rise for the rat king, ascendant to the throne in \the [get_area(src)].", source = src, action = NOTIFY_ORBIT, flashwindow = FALSE)
AddElement(/datum/element/ventcrawling, given_tier = VENTCRAWLER_ALWAYS)
/mob/living/simple_animal/hostile/regalrat/handle_automated_action()
if(prob(20))
riot.Trigger()

View File

@@ -30,6 +30,7 @@
setup_visuals()
/mob/living/simple_animal/hostile/zombie/proc/setup_visuals()
set waitfor = FALSE
var/datum/preferences/dummy_prefs = new
dummy_prefs.pref_species = new /datum/species/zombie
dummy_prefs.be_random_body = TRUE

View File

@@ -42,6 +42,7 @@
return ..()
/obj/machinery/rnd/production/proc/update_research()
set waitfor = FALSE
host_research.copy_research_to(stored_research, TRUE)
update_designs()