Merge pull request #13522 from silicons/async
Fixes the intermittent master controller lockups
This commit is contained in:
@@ -82,6 +82,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
return new_msg
|
||||
|
||||
/mob/living/say(message, bubble_type,var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
|
||||
set waitfor = FALSE
|
||||
var/static/list/crit_allowed_modes = list(MODE_WHISPER = TRUE, MODE_CHANGELING = TRUE, MODE_ALIEN = TRUE)
|
||||
var/static/list/unconscious_allowed_modes = list(MODE_CHANGELING = TRUE, MODE_ALIEN = TRUE)
|
||||
var/talk_key = get_key(message)
|
||||
|
||||
@@ -236,7 +236,7 @@ Auto Patrol[]"},
|
||||
if(targets.len>0)
|
||||
var/mob/living/carbon/t = pick(targets)
|
||||
if((t.stat!=2) && (t.lying != 1) && (!t.handcuffed)) //we don't shoot people who are dead, cuffed or lying down.
|
||||
shootAt(t)
|
||||
INVOKE_ASYNC(src, .proc/shootAt, t)
|
||||
switch(mode)
|
||||
|
||||
if(BOT_IDLE) // idle
|
||||
@@ -254,7 +254,7 @@ Auto Patrol[]"},
|
||||
|
||||
if(target) // make sure target exists
|
||||
if(Adjacent(target) && isturf(target.loc)) // if right next to perp
|
||||
stun_attack(target)
|
||||
INVOKE_ASYNC(src, .proc/stun_attack, target)
|
||||
|
||||
mode = BOT_PREP_ARREST
|
||||
anchored = TRUE
|
||||
|
||||
@@ -62,6 +62,9 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/wizard/handle_automated_action()
|
||||
. = ..()
|
||||
INVOKE_ASYNC(src, .proc/AutomatedCast)
|
||||
|
||||
/mob/living/simple_animal/hostile/wizard/proc/AutomatedCast()
|
||||
if(target && next_cast < world.time)
|
||||
if((get_dir(src,target) in list(SOUTH,EAST,WEST,NORTH)) && fireball.cast_check(0,src)) //Lined up for fireball
|
||||
src.setDir(get_dir(src,target))
|
||||
|
||||
@@ -436,12 +436,7 @@
|
||||
newspeak.Add(possible_phrase)
|
||||
speak = newspeak
|
||||
|
||||
//Search for item to steal
|
||||
parrot_interest = search_for_item()
|
||||
if(parrot_interest)
|
||||
emote("me", EMOTE_VISIBLE, "looks in [parrot_interest]'s direction and takes flight.")
|
||||
parrot_state = PARROT_SWOOP | PARROT_STEAL
|
||||
icon_state = icon_living
|
||||
INVOKE_ASYNC(src, .proc/attempt_item_theft)
|
||||
return
|
||||
|
||||
//-----WANDERING - This is basically a 'I dont know what to do yet' state
|
||||
@@ -620,6 +615,14 @@
|
||||
parrot_lastmove = src.loc
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/parrot/proc/attempt_item_theft()
|
||||
//Search for item to steal
|
||||
search_for_item()
|
||||
if(parrot_interest)
|
||||
emote("me", EMOTE_VISIBLE, "looks in [parrot_interest]'s direction and takes flight.")
|
||||
parrot_state = PARROT_SWOOP | PARROT_STEAL
|
||||
icon_state = icon_living
|
||||
|
||||
/mob/living/simple_animal/parrot/proc/search_for_item()
|
||||
var/item
|
||||
for(var/atom/movable/AM in view(src))
|
||||
|
||||
Reference in New Issue
Block a user