From bed6bc3d7393b4753bd2cf01ef913ea35bc60564 Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Sat, 9 Dec 2023 22:28:52 +0100 Subject: [PATCH] Improve scrubbers (#17892) * sd * unrelated bug i found * fafsd --- code/__defines/machinery.dm | 8 +++- code/game/objects/structures/coatrack.dm | 16 ------- code/modules/mob/living/living.dm | 22 +++++++++- .../fluffyghost-improvescrubbers.yml | 44 +++++++++++++++++++ 4 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 html/changelogs/fluffyghost-improvescrubbers.yml diff --git a/code/__defines/machinery.dm b/code/__defines/machinery.dm index 56f0daf73fa..4dd82657e11 100644 --- a/code/__defines/machinery.dm +++ b/code/__defines/machinery.dm @@ -105,8 +105,12 @@ var/list/restricted_camera_networks = list(NETWORK_ERT,NETWORK_MERCENARY,"Secret /* * Atmospherics Machinery. */ -#define MAX_SIPHON_FLOWRATE 2500 // L/s. This can be used to balance how fast a room is siphoned. Anything higher than CELL_VOLUME has no effect. -#define MAX_SCRUBBER_FLOWRATE 200 // L/s. Max flow rate when scrubbing from a turf. + +///Maximum flowrate, in L/s, that the scrubbers use when siphoning. Anything higher than `CELL_VOLUME` has no effect. +#define MAX_SIPHON_FLOWRATE 5000 + +///Maximum flowrate, in L/s, that the scrubbers use when scrubbing from a turf. +#define MAX_SCRUBBER_FLOWRATE 400 #define ATMOS_PUMP_MAX_PRESSURE 15000 diff --git a/code/game/objects/structures/coatrack.dm b/code/game/objects/structures/coatrack.dm index 3e616876a8b..f672012ffa8 100644 --- a/code/game/objects/structures/coatrack.dm +++ b/code/game/objects/structures/coatrack.dm @@ -57,22 +57,6 @@ else return ..() -/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - if(!coat && (istype(mover, /obj/item/clothing/suit/storage/toggle) || istype(mover, /obj/item/clothing/accessory/poncho))) - src.visible_message("[mover] lands on \the [src].") - coat = mover - coat.forceMove(src) - update_icon() - return 0 - else if(!hat && istype(mover, /obj/item/clothing/head)) - src.visible_message("[mover] lands on \the [src].") - hat = mover - hat.forceMove(src) - update_icon() - return 0 - else - return 1 - /obj/structure/coatrack/update_icon() cut_overlays() if(coat) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5661dc60b36..e27e503f5ec 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -172,15 +172,33 @@ default behaviour is: now_pushing = FALSE +/** + * Checks if two mobs can swap with each other based on the density + * + * Returns `TRUE` if the density allows them to swap, `FALSE` otherwise + * + * swapper - A `/mob`, the one trying to perform the swap + * swapee - A `/mob`, the one the `swapper` is trying to swap with + */ /proc/swap_density_check(var/mob/swapper, var/mob/swapee) + SHOULD_NOT_SLEEP(TRUE) + SHOULD_BE_PURE(TRUE) + var/turf/T = get_turf(swapper) + + if(!T) + return FALSE + if(T.density) - return 1 + return TRUE + for(var/atom/movable/A in T) + if(A == swapper) continue + if(!A.CanPass(swapee, T, 1)) - return 1 + return TRUE /mob/living/proc/can_swap_with(var/mob/living/tmob) if(tmob.buckled_to || buckled_to) diff --git a/html/changelogs/fluffyghost-improvescrubbers.yml b/html/changelogs/fluffyghost-improvescrubbers.yml new file mode 100644 index 00000000000..087785a1278 --- /dev/null +++ b/html/changelogs/fluffyghost-improvescrubbers.yml @@ -0,0 +1,44 @@ +################################ +# 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 +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: FluffyGhost + +# 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, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "increased the scrubbing and venting speed of the scrubbers." + - backend: "DMDoced the swap_density_check function, minor refactor." + - bugfix: "Fixed a runtime error encountered in the wild with mob swaps." + - rscdel: "Removed a collision handling of the coat hanger, that was violating the purity of checks."