From e1cdf3f4421745b6ae17c9b2e96f8a77c85e72d4 Mon Sep 17 00:00:00 2001 From: Batrachophreno Date: Sun, 3 Aug 2025 12:12:35 -0400 Subject: [PATCH] Hardsuit Module Press duplication bugfix (#21093) [Bugfix](https://github.com/Aurorastation/Aurora.3/issues/21084). Quick and easy duplication bug fix for the Hardsuit Module Press. --- code/modules/mining/machine_rigpress.dm | 33 ++++++++----- html/changelogs/Batra-RigpressDupeFix.yml | 58 +++++++++++++++++++++++ 2 files changed, 78 insertions(+), 13 deletions(-) create mode 100644 html/changelogs/Batra-RigpressDupeFix.yml diff --git a/code/modules/mining/machine_rigpress.dm b/code/modules/mining/machine_rigpress.dm index c9fc8780391..8fd86bd3987 100644 --- a/code/modules/mining/machine_rigpress.dm +++ b/code/modules/mining/machine_rigpress.dm @@ -32,33 +32,40 @@ else icon_state = "coinpress0" +/** + * If a compatible item is fed into the machine, begin conversion. Only allow one at a time. + */ /obj/machinery/mineral/rigpress/attackby(obj/item/attacking_item, mob/user) if(!pressing) var/outcome_path + // Check that the item is compatible. for(var/press_type in press_types) if(istype(attacking_item, press_type)) outcome_path = press_types[press_type] break - + // It's not. if(!outcome_path) ..() return to_chat(user, SPAN_NOTICE("You start feeding [attacking_item] into \the [src]")) if(do_after(user, 30)) - src.visible_message(SPAN_NOTICE("\The [src] begins to print out a modsuit.")) - pressing = TRUE - update_icon() - use_power_oneoff(500) - qdel(attacking_item) - spawn(300) - ping("\The [src] pings, \"Module successfuly produced!\"") - - new outcome_path(get_turf(src)) - - use_power_oneoff(500) - pressing = FALSE + // Extra !pressing check here to protect against button-mashers. Naughty naughty. + if(!pressing) + src.visible_message(SPAN_NOTICE("\The [src] begins to print out a modsuit.")) + pressing = TRUE update_icon() + use_power_oneoff(500) + qdel(attacking_item) + spawn(300) + ping("\The [src] pings, \"Module successfuly produced!\"") + new outcome_path(get_turf(src)) + + use_power_oneoff(500) + pressing = FALSE + update_icon() + else + src.visible_message(SPAN_WARNING("\The [src] is already printing something!")) else ..() diff --git a/html/changelogs/Batra-RigpressDupeFix.yml b/html/changelogs/Batra-RigpressDupeFix.yml new file mode 100644 index 00000000000..f1b9e28771b --- /dev/null +++ b/html/changelogs/Batra-RigpressDupeFix.yml @@ -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: Batrachophrenoboocosmomachia + +# 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: "Fixes Hardsuit Module Press duplication bug."