Prevents greimorians from stacking multiple webs on one tile (#20140)

See title. Works so far in my testing, should prevent the 200 webs on a
single turf issue we've all loved dealing with. This doesn't seem to be
intended behaviour, given there's a check against it in the code
already, so I'm putting it under bugfix.
This commit is contained in:
hazelrat
2024-11-06 17:10:25 +00:00
committed by GitHub
parent 0b4bb4ead1
commit cdea6ec56d
2 changed files with 66 additions and 8 deletions
@@ -255,9 +255,8 @@
addtimer(CALLBACK(src, PROC_REF(GiveUp), C), 100, TIMER_UNIQUE)
return
//second, spin a sticky spiderweb on this tile
var/obj/effect/spider/stickyweb/W = locate() in get_turf(src)
if(!W)
//second, spin a sticky spiderweb on this tile if there isn't already a spiderweb there
if(!locate(/obj/effect/spider/stickyweb) in src.loc)
busy = SPINNING_WEB
src.visible_message(SPAN_NOTICE("\The [src] begins to secrete a sticky substance."))
stop_automated_movement = 1
@@ -312,7 +311,7 @@
stop_automated_movement = 0
/mob/living/simple_animal/hostile/giant_spider/nurse/proc/finalize_web()
if(busy == SPINNING_WEB)
if(busy == SPINNING_WEB && !locate(/obj/effect/spider/stickyweb) in src.loc) // Additional check, to be extra-sure they don't stack webs.
new /obj/effect/spider/stickyweb(src.loc)
busy = 0
stop_automated_movement = 0
@@ -361,12 +360,13 @@
set desc = "Create a web that slows down movement."
set category = "Greimorian"
var/obj/effect/spider/stickyweb/W = locate() in get_turf(src)
if(!W)
to_chat(usr, SPAN_NOTICE("\The [src] begins to secrete a sticky substance."))
if(!do_after(src, 20))
if(!locate(/obj/effect/spider/stickyweb) in src.loc)
src.visible_message(SPAN_NOTICE("\The [src] begins to secrete a sticky substance."))
if(!do_after(src, 20) || locate(/obj/effect/spider/stickyweb) in src.loc) // Additional check so you can't queue it multiple times at once to stack webs.
return
new /obj/effect/spider/stickyweb(get_turf(src))
else
to_chat(usr, SPAN_WARNING("You cannot secrete webs on a turf that is already webbed!"))
/mob/living/simple_animal/hostile/giant_spider/nurse/verb/cocoon()