From fcc211552aa340f4d7348675bb543775ad060f3c Mon Sep 17 00:00:00 2001 From: Cameron Lennox Date: Thu, 7 Aug 2025 05:54:06 -0400 Subject: [PATCH] Fixes a server-crashing issue from woofs (#18172) * optimizes woof code prevents server crashes * static * maximum * woof * moved * Update softdog.dm --- .../simple_mob/subtypes/vore/softdog.dm | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/softdog.dm b/code/modules/mob/living/simple_mob/subtypes/vore/softdog.dm index c2d3827c72..7759a3002c 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/softdog.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/softdog.dm @@ -265,38 +265,37 @@ M.visible_message("The petting was interrupted!!!", runemessage = "The petting was interrupted") return +GLOBAL_VAR_INIT(woof_maximum, 0) +GLOBAL_VAR_INIT(woof_current, 0) /mob/living/simple_mob/vore/woof/hostile/aweful maxHealth = 100 health = 100 - var/killswitch = FALSE - + var/static/killswitch = FALSE /mob/living/simple_mob/vore/woof/hostile/aweful/Initialize(mapload) . = ..() var/thismany = (rand(25,500)) / 100 resize(thismany, animate = FALSE, uncapped = TRUE, ignore_prefs = TRUE) + if(!GLOB.woof_current) //all our previous brothers have gone to valhallah + GLOB.woof_maximum = 0 //Let's start duplicating again + GLOB.woof_current++ + +/mob/living/simple_mob/vore/woof/hostile/aweful/Destroy() + GLOB.woof_current-- + . = ..() /mob/living/simple_mob/vore/woof/hostile/aweful/death() . = ..() - if(killswitch) + var/thismany = rand(0,3) + if(!thismany || killswitch || GLOB.woof_maximum >= 20) visible_message(span_notice("\The [src] evaporates into nothing...")) qdel(src) return - var/thismany = rand(0,3) var/list/possiblewoofs = list(/mob/living/simple_mob/vore/woof/hostile/aweful/melee, /mob/living/simple_mob/vore/woof/hostile/aweful/ranged) - if(thismany == 0) - visible_message(span_notice("\The [src] evaporates into nothing...")) - if(thismany >= 1) - var/thiswoof = pick(possiblewoofs) - new thiswoof(loc, src) - visible_message(span_warning("Another [src] appears!")) - if(thismany >= 2) - var/thiswoof = pick(possiblewoofs) - new thiswoof(loc, src) - visible_message(span_warning("Another [src] appears!")) - if(thismany >= 3) - var/thiswoof = pick(possiblewoofs) - new thiswoof(loc, src) + for(var/i = 1 to thismany) + var/mob/living/simple_mob/vore/woof/hostile/aweful/woof = pick(possiblewoofs) + new woof(loc, src) + GLOB.woof_maximum++ visible_message(span_warning("Another [src] appears!")) qdel(src)