Fixes an issue with Hivebot bombers (#7327)

Basically if two exploded in close proximity to each other it could lead to infinite recursion, crashing the server.
This commit is contained in:
fernerr
2019-11-04 08:23:10 +01:00
committed by Erki
parent 61cec8bd7b
commit 26f7182fe9
2 changed files with 53 additions and 8 deletions
@@ -75,6 +75,7 @@
icon_state = "hivebotbomber"
attacktext = "bumped"
move_to_delay = 8
var/has_exploded = FALSE
/mob/living/simple_animal/hostile/hivebot/bomber/AttackingTarget()
..()
@@ -82,19 +83,22 @@
stance = HOSTILE_STANCE_TIRED
stop_automated_movement = 1
wander = 0
playsound(src.loc, 'sound/items/countdown.ogg', 125, 1)
spawn(20)
fragem(src,10,30,2,3,5,1,0)
src.gib()
if(!has_exploded)
playsound(src.loc, 'sound/items/countdown.ogg', 125, 1)
has_exploded = TRUE
addtimer(CALLBACK(src, .proc/burst), 20)
/mob/living/simple_animal/hostile/hivebot/bomber/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj, /obj/item/projectile/bullet/pistol/hivebotspike) || istype(Proj, /obj/item/projectile/beam/hivebot))
Proj.no_attack_log = 1
return PROJECTILE_CONTINUE
else
fragem(src,10,30,2,3,5,1,0)
src.gib()
else if(!has_exploded)
has_exploded = TRUE
burst()
/mob/living/simple_animal/hostile/hivebot/bomber/proc/burst()
fragem(src,10,30,2,3,5,1,0)
src.gib()
/mob/living/simple_animal/hostile/hivebot/range
name = "Hivebot"