From 67f4fa464f438e8254d652125fc2bd6e91e76225 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 02:22:34 +0000 Subject: [PATCH 1/9] Bump nanoid from 3.3.6 to 3.3.8 in /tgui (#6911) --- tgui/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tgui/yarn.lock b/tgui/yarn.lock index 6982d255ab11..a0f8817d3e68 100644 --- a/tgui/yarn.lock +++ b/tgui/yarn.lock @@ -10391,11 +10391,11 @@ __metadata: linkType: hard "nanoid@npm:^3.3.6": - version: 3.3.6 - resolution: "nanoid@npm:3.3.6" + version: 3.3.8 + resolution: "nanoid@npm:3.3.8" bin: nanoid: bin/nanoid.cjs - checksum: 10c0/606b355960d0fcbe3d27924c4c52ef7d47d3b57208808ece73279420d91469b01ec1dce10fae512b6d4a8c5a5432b352b228336a8b2202a6ea68e67fa348e2ee + checksum: 10c0/4b1bb29f6cfebf3be3bc4ad1f1296fb0a10a3043a79f34fbffe75d1621b4318319211cd420549459018ea3592f0d2f159247a6f874911d6d26eaaadda2478120 languageName: node linkType: hard From 85e24504a11c633dab99a63cb86a0826fcf559d1 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Mon, 23 Dec 2024 18:22:00 -0500 Subject: [PATCH 2/9] running bugfix PR (#6914) Co-authored-by: LordME <58342752+TheLordME@users.noreply.github.com> --- citadel.dme | 6 + code/__DEFINES/materials/helpers.dm | 35 +- code/__DEFINES/objects/objects.dm | 23 +- code/controllers/subsystem/atoms.dm | 27 +- code/datums/callback.dm | 27 +- code/datums/outfits/outfit.dm | 55 ++- code/datums/recipe/stack_recipe.dm | 28 +- code/game/atoms/_atom.dm | 12 + .../nanotrasen/nanotrasen-supply/medical.dm | 6 +- code/game/machinery/vending/medical.dm | 1 + code/game/objects/items-inventory-old.dm | 4 + code/game/objects/items/devices/flashlight.dm | 3 + code/game/objects/items/devices/t_scanner.dm | 2 +- code/game/objects/items/stacks/stack.dm | 5 + code/game/objects/items/storage/boxes.dm | 17 +- .../objects/items/storage/medical/hypokit.dm | 75 ++- .../objects/items/storage/misc/survival.dm | 9 + code/game/objects/items/storage/storage.dm | 18 +- code/game/objects/items/weapons/RCD.dm | 2 +- code/game/objects/obj.dm | 44 +- .../crates_lockers/closets/secure/medical.dm | 2 +- .../structures/crates_lockers/crates.dm | 2 +- code/game/objects/structures/loot_piles.dm | 2 +- .../systems/storage/storage-filters.dm | 29 ++ .../systems/storage/storage-indirection.dm | 30 ++ .../storage/storage-indirection_holder.dm | 46 ++ .../objects/systems/storage/storage-limits.dm | 34 ++ .../objects/systems/storage/storage-ui.dm | 255 ++++++++++ code/game/objects/systems/storage/storage.dm | 456 ++---------------- .../simulated/flooring/flooring_types.dm | 1 - code/game/turfs/turf.dm | 2 +- .../modules/admin/verbs/SDQL2/wrappers/map.dm | 5 +- .../admin/verbs/SDQL2/wrappers/math.dm | 28 ++ .../components/binary_devices/dp_vent_pump.dm | 4 +- .../machinery/components/component.dm | 4 +- .../components/omni_devices/omni_base.dm | 2 +- .../components/unary/heat_exchanger.dm | 2 +- .../machinery/components/unary/vent_pump.dm | 8 +- .../components/unary/vent_scrubber.dm | 4 +- .../atmospherics/machinery/machinery.dm | 2 +- code/modules/atmospherics/machinery/meter.dm | 2 +- .../atmospherics/machinery/pipes/pipe_base.dm | 4 +- .../atmospherics/machinery/pipes/universal.dm | 2 +- .../atmospherics/machinery/pipes/vent.dm | 2 +- code/modules/examine/descriptions/stacks.dm | 3 - code/modules/ghostroles/instantiator.dm | 3 - .../industry/disposals/disposal_frame.dm | 2 +- .../industry/disposals/disposal_pipe.dm | 2 +- .../materials/definitions/metals/steel.dm | 9 +- code/modules/materials/material.dm | 10 + code/modules/materials/material_sheets.dm | 28 +- code/modules/mining/tools/vertibore.dm | 4 +- code/modules/mob/holder.dm | 2 + .../mob/inventory/inventory-hands-check.dm | 2 + .../mob/inventory/inventory-hands-drop.dm | 2 + .../mob/inventory/inventory-hands-get.dm | 2 + .../mob/inventory/inventory-hands-legacy.dm | 2 + .../mob/inventory/inventory-hands-put.dm | 5 + code/modules/mob/inventory/inventory-hands.dm | 2 - .../mob/inventory/inventory-slot-equip.dm | 46 +- .../mob/living/silicon/robot/inventory.dm | 4 +- .../simple_mob/subtypes/vore/solarmoth.dm | 7 +- code/modules/mob/mob-inventory-internal.dm | 8 +- code/modules/mob/mob-inventory-stripping.dm | 8 +- code/modules/mob/mob-inventory.dm | 4 +- code/modules/organs/subtypes/nano.dm | 5 + code/modules/power/cable.dm | 2 +- code/modules/power/terminal.dm | 4 +- code/modules/random_map/drop/drop_types.dm | 8 +- code/modules/species/outsider/scori.dm | 3 - code/modules/species/outsider/vox.dm | 46 +- code/modules/species/promethean/promethean.dm | 12 +- code/modules/species/protean/protean.dm | 20 +- code/modules/species/species.dm | 107 ++-- code/modules/species/station/adherent.dm | 7 +- .../modules/species/station/custom_species.dm | 29 -- code/modules/species/station/diona.dm | 6 - code/modules/species/station/phoronoids.dm | 203 ++++---- .../species/station/standard/tajaran.dm | 12 +- .../species/station/standard/teshari.dm | 13 +- .../species/station/standard/unathi.dm | 12 +- .../species/station/standard/zaddat.dm | 50 +- icons/README.md | 1 + icons/materials/metals/steel.dmi | Bin 0 -> 1274 bytes maps/endeavour/levels/flagship.dmm | 16 +- maps/rift/levels/rift-05-surface2.dmm | 12 +- maps/rift/levels/rift-11-orbital.dmm | 16 +- maps/sectors/admin_planets_192/andromeda.dmm | 12 +- maps/sectors/admin_planets_192/croatoan.dmm | 22 +- maps/sectors/admin_planets_192/fey_map.dmm | 4 +- maps/templates/admin/dhael_centcom.dmm | 12 +- maps/templates/admin/ert.dmm | 6 +- maps/templates/admin/ert_base.dmm | 4 +- maps/templates/shelters/shelter_2.dmm | 2 +- maps/templates/shelters/shelter_4.dmm | 16 +- maps/templates/shelters/shelter_a.dmm | 4 +- .../shuttles/overmaps/generic/cruiser.dmm | 38 +- .../generic/overmap_ship_paperclipper.dmm | 8 +- .../shuttles/overmaps/generic/shelter_5.dmm | 8 +- .../shuttles/overmaps/generic/shelter_6.dmm | 28 +- maps/triumph/levels/flagship.dmm | 16 +- 101 files changed, 1346 insertions(+), 900 deletions(-) create mode 100644 code/game/objects/items/storage/misc/survival.dm create mode 100644 code/game/objects/systems/storage/storage-filters.dm create mode 100644 code/game/objects/systems/storage/storage-indirection.dm create mode 100644 code/game/objects/systems/storage/storage-indirection_holder.dm create mode 100644 code/game/objects/systems/storage/storage-limits.dm create mode 100644 code/modules/admin/verbs/SDQL2/wrappers/math.dm create mode 100644 icons/materials/metals/steel.dmi diff --git a/citadel.dme b/citadel.dme index 7c7f9707d0ac..a0160f3e7a30 100644 --- a/citadel.dme +++ b/citadel.dme @@ -1783,6 +1783,7 @@ #include "code\game\objects\items\storage\wallets.dm" #include "code\game\objects\items\storage\medical\firstaid.dm" #include "code\game\objects\items\storage\medical\hypokit.dm" +#include "code\game\objects\items\storage\misc\survival.dm" #include "code\game\objects\items\storage\misc_legacy\bible.dm" #include "code\game\objects\items\storage\misc_legacy\fancy.dm" #include "code\game\objects\items\storage\misc_legacy\laundry_basket.dm" @@ -2026,6 +2027,10 @@ #include "code\game\objects\structures\tables\update_triggers.dm" #include "code\game\objects\systems\_system.dm" #include "code\game\objects\systems\cell_slot.dm" +#include "code\game\objects\systems\storage\storage-filters.dm" +#include "code\game\objects\systems\storage\storage-indirection.dm" +#include "code\game\objects\systems\storage\storage-indirection_holder.dm" +#include "code\game\objects\systems\storage\storage-limits.dm" #include "code\game\objects\systems\storage\storage-screen_object.dm" #include "code\game\objects\systems\storage\storage-ui.dm" #include "code\game\objects\systems\storage\storage.dm" @@ -2259,6 +2264,7 @@ #include "code\modules\admin\verbs\SDQL2\SDQL_2_parser.dm" #include "code\modules\admin\verbs\SDQL2\SDQL_2_wrappers.dm" #include "code\modules\admin\verbs\SDQL2\wrappers\map.dm" +#include "code\modules\admin\verbs\SDQL2\wrappers\math.dm" #include "code\modules\admin\verbs\server\admin_reboot.dm" #include "code\modules\admin\view_variables\admin_delete.dm" #include "code\modules\admin\view_variables\color_matrix_editor.dm" diff --git a/code/__DEFINES/materials/helpers.dm b/code/__DEFINES/materials/helpers.dm index 70eafe784e50..793a43a26c31 100644 --- a/code/__DEFINES/materials/helpers.dm +++ b/code/__DEFINES/materials/helpers.dm @@ -1,14 +1,45 @@ //* This file is explicitly licensed under the MIT license. *// //* Copyright (c) 2023 Citadel Station developers. *// -//* object checks +//* /datum/prototype/material declaration helpers *// + +#define DECLARE_MATERIAL(PATH_FRAGMENT) \ +/datum/prototype/material##PATH_FRAGMENT + +/** + * Generates material stacks for a material. + * + * The material must have: + * + * * a defined `display_name` + * * a defined `sheet_singular_name` + * * a defined `sheet_plural_name` + * * a defined `icon` + * * a defined `icon_stack_count` + */ +#define GENERATE_MATERIAL_STACKS(PATH_FRAGMENT) \ +/obj/item/stack/material##PATH_FRAGMENT { \ + name = /datum/prototype/material##PATH_FRAGMENT::name + " " + /datum/prototype/material##PATH_FRAGMENT::sheet_singular_name; \ + icon = /datum/prototype/material##PATH_FRAGMENT::icon; \ + icon_state = "stack-1"; \ + material = /datum/prototype/material##PATH_FRAGMENT; \ + no_variants = TRUE; \ + amount = 1; \ +} \ +/obj/item/stack/material##PATH_FRAGMENT/full_stack { \ + name = /datum/prototype/material##PATH_FRAGMENT::name + " " + /datum/prototype/material##PATH_FRAGMENT::sheet_plural_name; \ + icon_state = "stack"; \ + amount = 50; \ +} + +//* Material Traits - Checks *// /// We are ticking materials. #define IS_TICKING_MATERIALS(A) (A.atom_flags & ATOM_MATERIALS_TICKING) #define START_TICKING_MATERIALS(A) SSmaterials.add_ticked_object(src) #define STOP_TICKING_MATERIALS(A) SSmaterials.remove_ticked_object(src) -//* /atom level invocation of traits +//* Material Traits - /atom invocation *// /// Invocation of material traits /// A - the atom diff --git a/code/__DEFINES/objects/objects.dm b/code/__DEFINES/objects/objects.dm index 65cdac7abb35..92cb1c25f747 100644 --- a/code/__DEFINES/objects/objects.dm +++ b/code/__DEFINES/objects/objects.dm @@ -1,16 +1,23 @@ //* This file is explicitly licensed under the MIT license. *// -//* Copyright (c) 2024 silicons *// +//* Copyright (c) 2024 Citadel Station Developers *// //* /obj/var/hides_underfloor /// do not change these willy-nilly, these are strings for the map editor. /// just Don't -#define OBJ_UNDERFLOOR_DISABLED "disabled" +/// * this is different from 'NEVER' +#define OBJ_UNDERFLOOR_UNSUPPORTED "unsupported" /// never underfloor, even if floor isn't plating #define OBJ_UNDERFLOOR_NEVER "never" -/// always underfloor, as long as floor isn't plating -#define OBJ_UNDERFLOOR_ALWAYS "always" +/// Should be underfloor, and is not currently underfloor. +/// * Setting to this at runtime is equal to setting to [OBJ_UNDERFLOOR_ACTIVE]. +/// The atom will automatically hide under the floor if the floor is covered. +#define OBJ_UNDERFLOOR_INACTIVE "inactive" +/// Should be underfloor, and is currently underfloor. +/// * Setting to this at runtime is equal to setting to [OBJ_UNDERFLOOR_INACTIVE]. +/// The atom will automatically hide under the floor if the floor is covered. +#define OBJ_UNDERFLOOR_ACTIVE "active" /// automatic /// /// * gets set to UNDERFLOOR_NEVER if we were made while the floor is intact @@ -18,6 +25,7 @@ #define OBJ_UNDERFLOOR_IF_CREATED_UNCOVERED "initially-covered" /// automatic /// +/// * This is what you usually want. /// * IF_CREATED_UNCOVERED, but always underfloor if made in mapload #define OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP "initially-underfloor" @@ -26,9 +34,10 @@ DEFINE_ENUM("obj_hides_underfloor", list( "hides_underfloor", ), ), list( - "Disabled" = OBJ_UNDERFLOOR_DISABLED, - "Never" = OBJ_UNDERFLOOR_NEVER, - "Always" = OBJ_UNDERFLOOR_ALWAYS, + "Unsupported" = OBJ_UNDERFLOOR_UNSUPPORTED, + "No" = OBJ_UNDERFLOOR_NEVER, + "Yes (Currently Uncovered)" = OBJ_UNDERFLOOR_INACTIVE, + "Yes (Currently Covered)" = OBJ_UNDERFLOOR_ACTIVE, "If Created Uncovered (Init Only)" = OBJ_UNDERFLOOR_IF_CREATED_UNCOVERED, "If Created Uncovered Or In Mapload (Init Only)" = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP, )) diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index 33e4e1156c9b..ce03cc2859c0 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -135,9 +135,34 @@ SUBSYSTEM_DEF(atoms) * * ... - rest of args are passed to new() / Initialize(). */ /datum/controller/subsystem/atoms/proc/instance_atom_immediate(path, mapload, atom/where, ...) + SHOULD_NOT_SLEEP(TRUE) var/old_init_status = atom_init_status atom_init_status = mapload? ATOM_INIT_IN_NEW_MAPLOAD : ATOM_INIT_IN_NEW_REGULAR - var/atom/created = new path(arglist(args.Copy())) + var/atom/created = new path(arglist(args.Copy(3))) + atom_init_status = old_init_status + return created + +/** + * immediately creates and inits an atom with a preloader callback. + * + * @params + * * path - typepath + * * mapload - treat as mapload? + * * preload_call - callback to invoke with (created) for the created atom. This is not allowed to sleep. + * * where - location to init at + * * ... - rest of args are passed to new() / Initialize(). + */ +/datum/controller/subsystem/atoms/proc/instance_atom_immediate_with_preloader(path, mapload, datum/callback/preload_call, atom/where, ...) + SHOULD_NOT_SLEEP(TRUE) + var/old_init_status = atom_init_status + atom_init_status = ATOM_INIT_IN_SUBSYSTEM + var/atom/created = new path(arglist(args.Copy(4))) + preload_call.invoke_no_sleep(created) + atom_init_status = mapload? ATOM_INIT_IN_NEW_MAPLOAD : ATOM_INIT_IN_NEW_REGULAR + // this sets 'where' to if we should be mapload. + // this is acceptable because args[4] ('where') is not used again. + args[4] = mapload + InitAtom(created, FALSE, args.Copy(4)) atom_init_status = old_init_status return created diff --git a/code/datums/callback.dm b/code/datums/callback.dm index 2087fd6ef448..3918cf039a44 100644 --- a/code/datums/callback.dm +++ b/code/datums/callback.dm @@ -101,24 +101,39 @@ else calling_arguments = args if(datum_flags & DF_VAR_EDITED) - return WrapAdminProcCall(object, delegate, calling_arguments) - if(object == GLOBAL_PROC) - return call(delegate)(arglist(calling_arguments)) - return call(object, delegate)(arglist(calling_arguments)) + . = WrapAdminProcCall(object, delegate, calling_arguments) + else if(object == GLOBAL_PROC) + . = call(delegate)(arglist(calling_arguments)) + else + . = call(object, delegate)(arglist(calling_arguments)) + pass() /** * Invoke this callback and crash if it sleeps. * * * Use when a callback should never sleep, as call() cannot be verified by static analysis. + * * Do not use in performance critical code. This wraps calls more aggressively than InvokeAsync(). + * * `null` is returned if the call sleeps. + * + * The specific use case here is an async call where: + * + * * It's always invalid behavior for a callback to sleep. + * * The caller should be protected (caller shouldn't be interrupted by the sleep). + * + * This allows enforcement of the above invariants by loudly runtiming and bringing attention to the issue, + * as opposed to the usual way of compile checking it (which we can't because this is a reflection-based call to an arbitrary proc). */ /datum/callback/proc/invoke_no_sleep(...) . = CALLBACK_SLEEP_SENTINEL - ASYNC - . = Invoke(arglist(args)) + . = invoke_no_sleep_call(arglist(args)) if(. == CALLBACK_SLEEP_SENTINEL) . = null CRASH("Callback [src] slept on a no-sleeping invoke.") +/datum/callback/proc/invoke_no_sleep_call(...) + set waitfor = FALSE + . = Invoke(arglist(args)) + /** * Invoke this callback async (waitfor=false) * diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm index 85823242f516..c377c1e9964e 100644 --- a/code/datums/outfits/outfit.dm +++ b/code/datums/outfits/outfit.dm @@ -141,8 +141,59 @@ for(var/i=0,i