From 93d51618fbea290d1fbd0c44207f94b484b687d0 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Thu, 11 Dec 2025 05:46:11 -0700 Subject: [PATCH] [MIRROR] Ventcrawling Item Whitelist Memory Savings (#12106) Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: Cameron Lennox --- code/__defines/ventcrawl.dm | 32 +++++++++++ .../human/species/station/prommie_blob.dm | 1 + .../species/station/protean/protean_blob.dm | 1 + .../mob/living/silicon/robot/drone/drone.dm | 11 ++-- .../mob/living/silicon/robot/drone/swarm.dm | 3 -- .../subtypes/animal/alien animals/catslug.dm | 54 +++++++------------ .../living/simple_mob/subtypes/slime/slime.dm | 10 +++- code/modules/mob/mob_defines.dm | 2 + code/modules/ventcrawl/ventcrawl.dm | 28 ++++------ .../living/simple_mob/subtypes/xenomorph.dm | 33 ------------ vorestation.dme | 1 + 11 files changed, 82 insertions(+), 94 deletions(-) create mode 100644 code/__defines/ventcrawl.dm diff --git a/code/__defines/ventcrawl.dm b/code/__defines/ventcrawl.dm new file mode 100644 index 0000000000..c79d674ff4 --- /dev/null +++ b/code/__defines/ventcrawl.dm @@ -0,0 +1,32 @@ +// DO NOT LEAVE A TRAILING COMMA! + +/// Things that are always considered legal to ventcrawl with. Usually because they are internal objects related to mob or game functionality. +#define VENTCRAWL_BASE_WHITELIST /atom/movable/screen, \ + /atom/movable/emissive_blocker, \ + /obj/machinery/camera, \ + /obj/item/radio/headset/mob_headset, \ + /obj/item/radio/borg, \ + /obj/item/rig/protean, \ + /obj/item/implant +//mob/living/simple_mob/borer, //VORESTATION AI TEMPORARY REMOVAL REPLACE BACK IN LIST WHEN RESOLVED + +/// Vore unique objects +#define VENTCRAWL_VORE_WHITELIST /obj/belly, \ + /obj/soulgem, \ + /obj/item/holder + +/// Reasonable items with a low chance of causing exploits, mostly for catslugs but allowed by default on other vent crawlers +#define VENTCRAWL_SMALLITEM_WHITELIST /obj/item/coin, \ + /obj/item/aliencoin, \ + /obj/item/toy, \ + /obj/item/clipboard, \ + /obj/item/paper, \ + /obj/item/pen, \ + /obj/item/canvas, \ + /obj/item/paint_palette, \ + /obj/item/paint_brush, \ + /obj/item/camera, \ + /obj/item/photo, \ + /obj/item/camera_film, \ + /obj/item/taperecorder, \ + /obj/item/rectape diff --git a/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm b/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm index 1720651b73..f1c79ebae8 100644 --- a/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm +++ b/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm @@ -510,6 +510,7 @@ if(blob.mob_radio) blob.mob_radio.forceMove(src) + equip_to_appropriate_slot(blob.mob_radio) // Actually put it back on the mob in a slot blob.mob_radio = null if(blob.myid) blob.myid = null diff --git a/code/modules/mob/living/carbon/human/species/station/protean/protean_blob.dm b/code/modules/mob/living/carbon/human/species/station/protean/protean_blob.dm index 9928a898d0..91a501c16d 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean/protean_blob.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean/protean_blob.dm @@ -574,6 +574,7 @@ if(blob.mob_radio) blob.mob_radio.forceMove(src) + equip_to_appropriate_slot(blob.mob_radio) // Actually put it back on the mob in a slot blob.mob_radio = null if(blob.myid) blob.myid = null diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 4e9aca885c..e732d4d11c 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -39,9 +39,6 @@ var/list/mob_hat_cache = list() can_pull_size = ITEMSIZE_NO_CONTAINER can_pull_mobs = MOB_PULL_SMALLER - can_enter_vent_with = list( - /obj, - /atom/movable/emissive_blocker) mob_bump_flag = SIMPLE_ANIMAL mob_swap_flags = SIMPLE_ANIMAL @@ -80,6 +77,14 @@ var/list/mob_hat_cache = list() /mob/living/silicon/robot/drone/is_sentient() return FALSE +/mob/living/silicon/robot/drone/ventcrawl_get_item_whitelist() + // Yes this allows any object, yes it's silly. I don't know if it's ever been abused by drones though. + return list( + /atom/movable/emissive_blocker, + /atom/movable/screen, + /obj + ) + /mob/living/silicon/robot/drone/construction name = "construction drone" icon_state = "constructiondrone" diff --git a/code/modules/mob/living/silicon/robot/drone/swarm.dm b/code/modules/mob/living/silicon/robot/drone/swarm.dm index 9278f9b441..ab2d02212e 100644 --- a/code/modules/mob/living/silicon/robot/drone/swarm.dm +++ b/code/modules/mob/living/silicon/robot/drone/swarm.dm @@ -22,9 +22,6 @@ can_pull_size = ITEMSIZE_NO_CONTAINER can_pull_mobs = MOB_PULL_SMALLER - can_enter_vent_with = list( - /obj, - /atom/movable/emissive_blocker) mob_always_swap = 1 diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/catslug.dm b/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/catslug.dm index c2c9c25339..e59ec37c4a 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/catslug.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/catslug.dm @@ -60,42 +60,6 @@ allow_mind_transfer = TRUE - - can_enter_vent_with = list( - /obj/item/implant, - /obj/item/radio/borg, - /obj/item/holder, - /obj/machinery/camera, - /obj/belly, - /obj/soulgem, - /atom/movable/screen, - /atom/movable/emissive_blocker, - /obj/item/material, - /obj/item/melee, - /obj/item/stack/, - /obj/item/tool, - /obj/item/reagent_containers/food, - /obj/item/coin, - /obj/item/aliencoin, - /obj/item/ore, - /obj/item/disk/nuclear, - /obj/item/toy, - /obj/item/card, - /obj/item/radio, - /obj/item/perfect_tele_beacon, - /obj/item/clipboard, - /obj/item/paper, - /obj/item/pen, - /obj/item/canvas, - /obj/item/paint_palette, - /obj/item/paint_brush, - /obj/item/camera, - /obj/item/photo, - /obj/item/camera_film, - /obj/item/taperecorder, - /obj/item/rectape - ) - vore_active = 1 vore_capacity = 1 vore_bump_chance = 1 @@ -126,6 +90,24 @@ B.absorbchance = 1 B.escapechance = 15 +/mob/living/simple_mob/vore/alienanimals/catslug/ventcrawl_get_item_whitelist() + return list( + VENTCRAWL_BASE_WHITELIST, + VENTCRAWL_VORE_WHITELIST, + VENTCRAWL_SMALLITEM_WHITELIST, + // Catslug unique items. + /obj/item/material, + /obj/item/melee, + /obj/item/stack/, + /obj/item/tool, + /obj/item/reagent_containers/food, + /obj/item/ore, + /obj/item/disk/nuclear, + /obj/item/card, + /obj/item/radio, + /obj/item/perfect_tele_beacon, + ) + /datum/ai_holder/simple_mob/melee/evasive/catslug hostile = FALSE cooperative = FALSE diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/slime.dm b/code/modules/mob/living/simple_mob/subtypes/slime/slime.dm index f9c11a0263..bc281e5b73 100644 --- a/code/modules/mob/living/simple_mob/subtypes/slime/slime.dm +++ b/code/modules/mob/living/simple_mob/subtypes/slime/slime.dm @@ -80,8 +80,6 @@ var/list/_slime_default_emotes = list( var/injection_amount = 5 // This determines how much. var/mood = ":3" // Icon to use to display 'mood', as an overlay. - can_enter_vent_with = list(/obj/item/clothing/head, /obj/soulgem) - can_be_drop_prey = FALSE species_sounds = "Slime" @@ -109,6 +107,14 @@ var/list/_slime_default_emotes = list( drop_hat() return ..() +/mob/living/silicon/robot/drone/ventcrawl_get_item_whitelist() + return list( + VENTCRAWL_BASE_WHITELIST, + VENTCRAWL_VORE_WHITELIST, + // Slime unique items + /obj/item/clothing/head, + ) + /mob/living/simple_mob/slime/death() // Make dead slimes stop glowing. glow_toggle = FALSE diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 540bb36c57..433e01d36d 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -182,6 +182,8 @@ var/voice_name = "unidentifiable voice" + var/list/ventcraw_item_admin_allow = null // If this is a list, it will be appended to the default list of items the mob is allowed to ventcrawl with + var/faction = FACTION_NEUTRAL //Used for checking whether hostile simple animals will attack you, possibly more stuff later var/can_be_antagged = FALSE // To prevent pAIs/mice/etc from getting antag in autotraitor and future auto- modes. Uses inheritance instead of a bunch of typechecks. diff --git a/code/modules/ventcrawl/ventcrawl.dm b/code/modules/ventcrawl/ventcrawl.dm index bef1b7f4af..f0360faaba 100644 --- a/code/modules/ventcrawl/ventcrawl.dm +++ b/code/modules/ventcrawl/ventcrawl.dm @@ -3,22 +3,6 @@ var/list/ventcrawl_machinery = list( /obj/machinery/atmospherics/unary/vent_scrubber ) -// Vent crawling whitelisted items, whoo -/mob/living/var/list/can_enter_vent_with = list( - /obj/item/implant, - /obj/item/radio/borg, - /obj/item/radio/headset/mob_headset, - /obj/item/holder, - /obj/machinery/camera, - /obj/belly, - /obj/soulgem, - /atom/movable/screen, - /atom/movable/emissive_blocker, - /obj/item/rig/protean - ) - //VOREStation Edit : added /obj/belly, to this list, CI is complaining about this in his indentation check. Added mob_headset for those with radios so there's no weirdness. - //mob/living/simple_mob/borer, //VORESTATION AI TEMPORARY REMOVAL REPLACE BACK IN LIST WHEN RESOLVED //VOREStation Edit - /mob/living/var/list/icon/pipes_shown = list() /mob/living/var/last_played_vent /mob/living/var/is_ventcrawling = FALSE @@ -75,7 +59,10 @@ var/list/ventcrawl_machinery = list( return TRUE //Try to find it in our allowed list (istype includes subtypes) var/listed = FALSE - for(var/test_type in can_enter_vent_with) + var/list/vent_allow = ventcrawl_get_item_whitelist() + if(islist(ventcraw_item_admin_allow)) // If mob has a list varedited onto it, we allow anything in this list as well + vent_allow += ventcraw_item_admin_allow + for(var/test_type in vent_allow) if(istype(carried_item,test_type)) listed = TRUE break @@ -108,6 +95,13 @@ var/list/ventcrawl_machinery = list( return FALSE return TRUE +/mob/living/proc/ventcrawl_get_item_whitelist() + return list( + VENTCRAWL_BASE_WHITELIST, + VENTCRAWL_VORE_WHITELIST, + VENTCRAWL_SMALLITEM_WHITELIST + ) + /mob/living/simple_mob/protean_blob/ventcrawl_carry() for(var/atom/A in contents) if(!is_allowed_vent_crawl_item(A)) diff --git a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/xenomorph.dm b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/xenomorph.dm index 4bc552eb9d..f151968d6c 100644 --- a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/xenomorph.dm +++ b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/xenomorph.dm @@ -46,39 +46,6 @@ 'sound/voice/hiss5.ogg') has_hands = TRUE - can_enter_vent_with = list( /obj/item/implant, - /obj/item/radio/borg, - /obj/item/holder, - /obj/machinery/camera, - /obj/belly, - /obj/soulgem, // CHOMPAdd - /atom/movable/screen, - /atom/movable/emissive_blocker, - /obj/item/material, - /obj/item/melee, - /obj/item/stack/, - /obj/item/tool, - /obj/item/reagent_containers/food, - /obj/item/coin, - /obj/item/aliencoin, - /obj/item/ore, - /obj/item/disk/nuclear, - /obj/item/toy, - /obj/item/card, - /obj/item/radio, - /obj/item/perfect_tele_beacon, - /obj/item/clipboard, - /obj/item/paper, - /obj/item/pen, - /obj/item/canvas, - /obj/item/paint_palette, - /obj/item/paint_brush, - /obj/item/camera, - /obj/item/photo, - /obj/item/camera_film, - /obj/item/taperecorder, - /obj/item/tape) - var/xeno_build_time = 5 //time to build a structure //HUD diff --git a/vorestation.dme b/vorestation.dme index 2247373f20..be8b496470 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -213,6 +213,7 @@ #include "code\__defines\update_icons.dm" #include "code\__defines\var_copy.dm" #include "code\__defines\vchatlog.dm" +#include "code\__defines\ventcrawl.dm" #include "code\__defines\verb_manager.dm" #include "code\__defines\visualnet.dm" #include "code\__defines\vore.dm"