Attempts to fix phantom bot path overlays (#19360)

* a

* more things

* two more cheeky spots
This commit is contained in:
S34N
2022-11-06 10:26:29 +00:00
committed by GitHub
parent 9657be2527
commit 0f4157d31e
5 changed files with 22 additions and 1 deletions
@@ -184,6 +184,7 @@
/mob/living/simple_animal/bot/Destroy()
if(paicard)
ejectpai()
set_path(null)
if(path_hud)
QDEL_NULL(path_hud)
path_hud = null
@@ -593,6 +594,7 @@ Pass a positive integer as an argument to override a bot's default speed.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mob/living/simple_animal/bot/proc/bot_patrol()
set_path(null)
patrol_step()
addtimer(CALLBACK(src, .proc/do_patrol), 5)
@@ -601,7 +603,7 @@ Pass a positive integer as an argument to override a bot's default speed.
patrol_step()
/mob/living/simple_animal/bot/proc/start_patrol()
set_path(null)
if(tries >= BOT_STEP_MAX_RETRIES) //Bot is trapped, so stop trying to patrol.
auto_patrol = FALSE
tries = 0
@@ -1035,6 +1037,7 @@ Pass a positive integer as an argument to override a bot's default speed.
for(var/V in path_huds_watching_me)
var/datum/atom_hud/H = V
H.remove_from_hud(src)
clear_path_image()
var/list/path_images = hud_list[DIAG_PATH_HUD]
QDEL_LIST(path_images)
@@ -1088,5 +1091,13 @@ Pass a positive integer as an argument to override a bot's default speed.
I.icon_state = null
path.Cut(1, 2)
/mob/living/simple_animal/bot/proc/clear_path_image()
if(!path || !length(path))
return
for(var/P in path)
var/image/I = path[P]
if(I?.icon_state)
I.icon_state = null
/mob/living/simple_animal/bot/proc/drop_part(obj/item/drop_item, dropzone)
new drop_item(dropzone)
@@ -91,6 +91,7 @@
oldtarget_name = null
anchored = FALSE
walk_to(src,0)
set_path(null)
last_found = world.time
set_weapon()
@@ -245,6 +246,7 @@
if(BOT_IDLE) // idle
walk_to(src,0)
set_path(null)
if(!lasercolor) //lasertag bots don't want to arrest anyone
look_for_perp() // see if any criminals are in range
if(!mode && auto_patrol) // still idle, and set to patrol
@@ -254,6 +256,7 @@
// if can't reach perp for long enough, go idle
if(frustration >= 8)
walk_to(src,0)
set_path(null)
back_to_idle()
if(target) // make sure target exists
@@ -109,6 +109,7 @@
if(BOT_IDLE) // idle
icon_state = "griefsky1"
walk_to(src,0)
set_path(null)
look_for_perp() // see if any criminals are in range
if(!mode && auto_patrol) // still idle, and set to patrol
mode = BOT_START_PATROL // switch to patrol mode
@@ -117,6 +118,7 @@
playsound(loc,'sound/effects/spinsabre.ogg',50,1,-1)
if(frustration >= frustration_number) // general beepsky doesn't give up so easily, jedi scum
walk_to(src,0)
set_path(null)
back_to_idle()
return
if(target) // make sure target exists
@@ -107,6 +107,7 @@
oldtarget_name = null
anchored = FALSE
walk_to(src,0)
set_path(null)
last_found = world.time
/mob/living/simple_animal/bot/secbot/set_custom_texts()
@@ -306,6 +307,7 @@
switch(mode)
if(BOT_IDLE) // idle
walk_to(src,0)
set_path(null)
look_for_perp() // see if any criminals are in range
if(!mode && auto_patrol) // still idle, and set to patrol
mode = BOT_START_PATROL // switch to patrol mode
@@ -314,6 +316,7 @@
// if can't reach perp for long enough, go idle
if(frustration >= 8)
walk_to(src,0)
set_path(null)
back_to_idle()
return
@@ -82,12 +82,14 @@
switch(mode)
if(BOT_IDLE)
walk_to(src,0)
set_path(null)
look_for_perp()
if(!mode && auto_patrol)
mode = BOT_START_PATROL
if(BOT_HUNT)
if(frustration >= 8)
walk_to(src,0)
set_path(null)
back_to_idle()
if(target)
if(isliving(target))