Skip to content

Commit

Permalink
Prevents greimorians from stacking multiple webs on one tile (#20140)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hazelrat authored Nov 6, 2024
1 parent 0b4bb4e commit cdea6ec
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 8 deletions.
16 changes: 8 additions & 8 deletions code/modules/mob/living/simple_animal/hostile/giant_spider.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
58 changes: 58 additions & 0 deletions html/changelogs/hazelmouse-webfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################

# Your name.
author: hazelmouse

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Greimorians should no longer be able to spin multiple webs on one tile."

0 comments on commit cdea6ec

Please sign in to comment.