From a272557ccde2d7978998ff43a8df3af338291630 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Fri, 29 Aug 2025 16:12:10 -0700 Subject: [PATCH] [MIRROR] sane stacks (#11533) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> --- .../binary_devices/algae_generator_vr.dm | 4 +--- code/__defines/materials.dm | 14 +++++++++++--- code/game/objects/items/stacks/tiles/tile_types.dm | 3 ++- code/game/objects/structures/bonfire.dm | 1 + code/game/objects/structures/gravemarker.dm | 1 + code/game/objects/structures/props/puzzledoor.dm | 2 +- .../objects/structures/stool_bed_chair_nest/bed.dm | 1 + .../structures/stool_bed_chair_nest/stools.dm | 5 +++-- code/game/turfs/simulated/dungeon/wall.dm | 4 ++-- .../modules/admin/view_variables/view_variables.dm | 3 +++ code/modules/client/client procs.dm | 2 +- code/modules/hydroponics/beekeeping/beehive.dm | 4 ++-- code/modules/materials/materials/alien_alloy.dm | 8 ++++---- code/modules/materials/sheets/_sheets.dm | 1 + code/modules/mining/machinery/machine_stacking.dm | 2 +- code/modules/mining/ore_vr.dm | 2 +- .../species/station/protean/protean_species.dm | 3 +-- .../subtypes/animal/giant_spider/tunneler.dm | 6 +++++- code/modules/recycling/recycling.dm | 2 +- code/modules/tables/presets.dm | 2 +- code/modules/turbolift/turbolift_turfs.dm | 2 +- 21 files changed, 45 insertions(+), 27 deletions(-) diff --git a/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm b/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm index aa7f9a2f7f..a06851a52c 100644 --- a/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm +++ b/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm @@ -234,9 +234,7 @@ var/recursive = amount == -1 ? 1 : 0 var/datum/material/matdata = get_material_by_name(material_name) var/stack_type = matdata.stack_type - var/obj/item/stack/material/S = new stack_type(loc) - if(amount <= 0) - amount = S.max_amount + var/obj/item/stack/material/S = new stack_type(loc, -1) var/ejected = min(round(stored_material[material_name] / S.perunit), amount) if(!S.set_amount(min(ejected, amount))) return diff --git a/code/__defines/materials.dm b/code/__defines/materials.dm index 01d70bdf78..91a1082aff 100644 --- a/code/__defines/materials.dm +++ b/code/__defines/materials.dm @@ -56,9 +56,6 @@ #define MAT_PLASTEELREBAR "plasteel rebar" #define MAT_GRASS "grass" #define MAT_RESIN "resin" -#define MAT_CULT "cult" -#define MAT_CULT2 "cult2" -#define MAT_ALIENALLOY "alienalloy" #define MAT_COMPOSITE "composite" #define MAT_BIOMASS "biomass" #define MAT_WEEDEXTRACT "weed extract" @@ -71,6 +68,17 @@ #define MAT_FOAM "foam" #define MAT_FLOKIUM "flockium" #define MAT_SMOLEBRICKS "smolebricks" +#define MAT_WAX "wax" + +#define MAT_CULT "cult" +#define MAT_CULT2 "cult2" + +// ALien materials +#define MAT_ALIENALLOY "alienalloy" +#define MAT_ALIEN_ALIUM "alium" +#define MAT_ALIEN_BEDROCK "bedrock" +#define MAT_ALIEN_DUNGEON "dungeonium" +#define MAT_ALIEN_ELEVAT "elevatorium" // cloth materials #define MAT_WOOL "wool" diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index ab92f96d3d..e7bfd003ec 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -38,6 +38,7 @@ if(craftable) material = get_material_by_name("[default_type]") if(!material) + stack_trace("Material of type: [default_type] does not exist.") return INITIALIZE_HINT_QDEL if(material) //sanity check recipes = material.get_recipes() @@ -76,7 +77,7 @@ singular_name = "grass floor tile" desc = "A patch of grass like they often use on golf courses." icon_state = "tile_grass" - default_type = "grass" + default_type = MAT_GRASS force = 1.0 throwforce = 1.0 throw_speed = 5 diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm index f8157232c7..9464606e1d 100644 --- a/code/game/objects/structures/bonfire.dm +++ b/code/game/objects/structures/bonfire.dm @@ -19,6 +19,7 @@ material_name = MAT_WOOD material = get_material_by_name("[material_name]") if(!material) + stack_trace("Material of type: [material_name] does not exist.") return INITIALIZE_HINT_QDEL color = material.icon_colour diff --git a/code/game/objects/structures/gravemarker.dm b/code/game/objects/structures/gravemarker.dm index afdf8b468f..05c81c61d6 100644 --- a/code/game/objects/structures/gravemarker.dm +++ b/code/game/objects/structures/gravemarker.dm @@ -24,6 +24,7 @@ material_name = MAT_WOOD material = get_material_by_name("[material_name]") if(!material) + stack_trace("Material of type: [material_name] does not exist.") return INITIALIZE_HINT_QDEL color = material.icon_colour AddElement(/datum/element/climbable) diff --git a/code/game/objects/structures/props/puzzledoor.dm b/code/game/objects/structures/props/puzzledoor.dm index 55a19f404f..adca46240e 100644 --- a/code/game/objects/structures/props/puzzledoor.dm +++ b/code/game/objects/structures/props/puzzledoor.dm @@ -37,7 +37,7 @@ /obj/machinery/door/blast/puzzle/Initialize(mapload) . = ..() - implicit_material = get_material_by_name("dungeonium") + implicit_material = get_material_by_name(MAT_ALIEN_DUNGEON) if(locks.len) return var/check_range = world.view * checkrange_mult diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 5d28d928e9..97f6c96ac8 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -30,6 +30,7 @@ new_material = MAT_STEEL material = get_material_by_name(new_material) if(!istype(material)) + stack_trace("Material of type: [new_material] does not exist.") return INITIALIZE_HINT_QDEL if(new_padding_material) padding_material = get_material_by_name(new_padding_material) diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index e8668480bf..dbbcc7fe3f 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -23,10 +23,11 @@ if(!new_material) new_material = MAT_STEEL material = get_material_by_name(new_material) + if(!istype(material)) + stack_trace("Material of type: [new_material] does not exist.") + return INITIALIZE_HINT_QDEL if(new_padding_material) padding_material = get_material_by_name(new_padding_material) - if(!istype(material)) - return INITIALIZE_HINT_QDEL force = round(material.get_blunt_damage()*0.4) update_icon() diff --git a/code/game/turfs/simulated/dungeon/wall.dm b/code/game/turfs/simulated/dungeon/wall.dm index fa9d132244..5c3a2b0770 100644 --- a/code/game/turfs/simulated/dungeon/wall.dm +++ b/code/game/turfs/simulated/dungeon/wall.dm @@ -4,7 +4,7 @@ block_tele = TRUE // Anti-cheese. /turf/simulated/wall/dungeon/Initialize(mapload) - . = ..(mapload, "dungeonium") + . = ..(mapload, MAT_ALIEN_DUNGEON) /turf/simulated/wall/dungeon/attackby() return @@ -38,7 +38,7 @@ block_tele = TRUE /turf/simulated/wall/solidrock/Initialize(mapload) - . = ..(mapload, "bedrock") + . = ..(mapload, MAT_ALIEN_BEDROCK) /turf/simulated/wall/solidrock/Initialize(mapload) . = ..() diff --git a/code/modules/admin/view_variables/view_variables.dm b/code/modules/admin/view_variables/view_variables.dm index 2ed195dd02..4bf0a2ec4f 100644 --- a/code/modules/admin/view_variables/view_variables.dm +++ b/code/modules/admin/view_variables/view_variables.dm @@ -38,8 +38,10 @@ ADMIN_VERB_AND_CONTEXT_MENU(debug_variables, (R_DEBUG|R_SERVER|R_ADMIN|R_SPAWN|R var/type = islist ? /list : thing.type var/no_icon = FALSE + var/cord_line if(isatom(thing)) var/atom/AT = thing + cord_line = "x:[AT.x] y:[AT.y] z:[AT.z] " if(use_gfi) sprite = getFlatIcon(thing) if(!sprite) @@ -265,6 +267,7 @@ ADMIN_VERB_AND_CONTEXT_MENU(debug_variables, (R_DEBUG|R_SERVER|R_ADMIN|R_SPAWN|R [tagged_line] [varedited_line] [deleted_line] +
[cord_line] diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 78d506cae0..b993a7e0bf 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -355,8 +355,8 @@ X << 'sound/voice/bcriminal.ogg' //ChompEDIT - back to beepsky window_flash(X) //VOREStation Edit end. - fully_created = TRUE attempt_auto_fit_viewport() + fully_created = TRUE // Now that we're fully initialized, use our prefs if(prefs?.read_preference(/datum/preference/toggle/browser_dev_tools)) diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm index fe90a93b12..f692068db4 100644 --- a/code/modules/hydroponics/beekeeping/beehive.dm +++ b/code/modules/hydroponics/beekeeping/beehive.dm @@ -305,7 +305,7 @@ desc = "Soft substance produced by bees. Used to make candles." icon = 'icons/obj/beekeeping.dmi' icon_state = "wax" - default_type = "wax" + default_type = MAT_WAX pass_color = TRUE strict_color_stacking = TRUE @@ -314,7 +314,7 @@ recipes = wax_recipes /datum/material/wax - name = "wax" + name = MAT_WAX stack_type = /obj/item/stack/material/wax icon_colour = "#fff343" melting_point = T0C+300 diff --git a/code/modules/materials/materials/alien_alloy.dm b/code/modules/materials/materials/alien_alloy.dm index 21d8a0224f..47225ac772 100644 --- a/code/modules/materials/materials/alien_alloy.dm +++ b/code/modules/materials/materials/alien_alloy.dm @@ -14,27 +14,27 @@ wiki_flag = WIKI_SPOILER /datum/material/alienalloy/elevatorium - name = "elevatorium" + name = MAT_ALIEN_ELEVAT display_name = "elevator panelling" table_icon_base = "stone" icon_colour = "#666666" /datum/material/alienalloy/dungeonium - name = "dungeonium" + name = MAT_ALIEN_DUNGEON display_name = "ultra-durable" icon_base = "dungeon" table_icon_base = "stone" icon_colour = "#FFFFFF" /datum/material/alienalloy/bedrock - name = "bedrock" + name = MAT_ALIEN_BEDROCK display_name = "impassable rock" icon_base = "rock" table_icon_base = "stone" icon_colour = "#FFFFFF" /datum/material/alienalloy/alium - name = "alium" + name = MAT_ALIEN_ALIUM display_name = "alien" icon_base = "alien" table_icon_base = "alien" diff --git a/code/modules/materials/sheets/_sheets.dm b/code/modules/materials/sheets/_sheets.dm index 6ef5cd196f..53b7cd74d9 100644 --- a/code/modules/materials/sheets/_sheets.dm +++ b/code/modules/materials/sheets/_sheets.dm @@ -31,6 +31,7 @@ default_type = MAT_STEEL material = get_material_by_name("[default_type]") if(!material) + stack_trace("Material of type: [default_type] does not exist.") return INITIALIZE_HINT_QDEL recipes = material.get_recipes() diff --git a/code/modules/mining/machinery/machine_stacking.dm b/code/modules/mining/machinery/machine_stacking.dm index 048298d7a2..e080f2e9da 100644 --- a/code/modules/mining/machinery/machine_stacking.dm +++ b/code/modules/mining/machinery/machine_stacking.dm @@ -18,7 +18,7 @@ machine.console = src else //Silently failing and causing mappers to scratch their heads while runtiming isn't ideal. - to_world(span_danger("Warning: Stacking machine console at [src.x], [src.y], [src.z] could not find its machine!")) + stack_trace(span_danger("Warning: Stacking machine console at [src.x], [src.y], [src.z] could not find its machine!")) return INITIALIZE_HINT_QDEL /obj/machinery/mineral/stacking_unit_console/attack_hand(mob/user) diff --git a/code/modules/mining/ore_vr.dm b/code/modules/mining/ore_vr.dm index c09f0772f3..d57e4412aa 100644 --- a/code/modules/mining/ore_vr.dm +++ b/code/modules/mining/ore_vr.dm @@ -2,4 +2,4 @@ name = "rutile" icon_state = "ore_rutile" origin_tech = list(TECH_MATERIAL = 2) - material = "rutile" + material = ORE_RUTILE diff --git a/code/modules/mob/living/carbon/human/species/station/protean/protean_species.dm b/code/modules/mob/living/carbon/human/species/station/protean/protean_species.dm index 79e533bf7b..d07c25ac3f 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean/protean_species.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean/protean_species.dm @@ -208,8 +208,7 @@ /datum/species/protean/equip_survival_gear(var/mob/living/carbon/human/H) ..() - var/obj/item/stack/material/steel/metal_stack = new() - metal_stack.set_amount(5) + var/obj/item/stack/material/steel/metal_stack = new(null, 5) var/obj/item/clothing/accessory/permit/nanotech/permit = new() permit.set_name(H.real_name) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/tunneler.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/tunneler.dm index e757328cf2..628c59ed46 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/tunneler.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/tunneler.dm @@ -150,7 +150,9 @@ for(var/i = 1 to get_dist(src, destination)) if(stat) return FALSE // We died or got knocked out on the way. - if(loc == destination) + + var/last_loc = loc + if(last_loc == destination) break // We somehow got there early. // Update T. @@ -176,6 +178,8 @@ dig_under_floor(get_turf(src)) playsound(src, 'sound/effects/break_stone.ogg', 75, 1) sleep(tunnel_tile_speed) + if(last_loc == loc) + return FALSE // For visuals. /mob/living/simple_mob/animal/giant_spider/tunneler/proc/submerge() diff --git a/code/modules/recycling/recycling.dm b/code/modules/recycling/recycling.dm index b63040661f..91598b24d9 100644 --- a/code/modules/recycling/recycling.dm +++ b/code/modules/recycling/recycling.dm @@ -219,7 +219,7 @@ if(S && S.get_amount() < S.max_amount) S.add(1) else - new stacktype(T) + new stacktype(T, 1) /obj/item/debris_pack name = "debris" diff --git a/code/modules/tables/presets.dm b/code/modules/tables/presets.dm index 7c1749e547..af589acd93 100644 --- a/code/modules/tables/presets.dm +++ b/code/modules/tables/presets.dm @@ -132,7 +132,7 @@ can_plate = FALSE /obj/structure/table/alien/Initialize(mapload) - material = get_material_by_name("alium") + material = get_material_by_name(MAT_ALIEN_ALIUM) verbs -= /obj/structure/table/verb/do_flip verbs -= /obj/structure/table/proc/do_put . = ..() diff --git a/code/modules/turbolift/turbolift_turfs.dm b/code/modules/turbolift/turbolift_turfs.dm index 0fb3302885..b98a889280 100644 --- a/code/modules/turbolift/turbolift_turfs.dm +++ b/code/modules/turbolift/turbolift_turfs.dm @@ -1,2 +1,2 @@ /turf/simulated/wall/elevator/Initialize(mapload) - . = ..(mapload, "elevatorium") + . = ..(mapload, MAT_ALIEN_ELEVAT)