From a2a0e237a6c55b6645b743481b74af2afd7a8a3e Mon Sep 17 00:00:00 2001 From: Killian <49700375+KillianKirilenko@users.noreply.github.com> Date: Thu, 2 Jan 2025 07:49:12 +0000 Subject: [PATCH] sample scooping sanity (#16812) --- code/modules/samples/container.dm | 10 +++++++--- code/modules/samples/samples.dm | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/code/modules/samples/container.dm b/code/modules/samples/container.dm index 20aea763a2..5ca55298f8 100644 --- a/code/modules/samples/container.dm +++ b/code/modules/samples/container.dm @@ -27,9 +27,13 @@ /obj/item/storage/sample_container/afterattack(turf/T as turf, mob/user as mob) for(var/obj/item/research_sample/S in T) - S.loc = src - update_icon() - to_chat(user, span_notice("You scoop \the [S] into \the [src].")) + if(contents.len >= max_storage_space) + to_chat(user, span_notice("\The [src] is full!")) + return + else + S.loc = src + update_icon() + to_chat(user, span_notice("You scoop \the [S] into \the [src].")) //Splice research sample containers into the list of valid items for these belts *without* overriding the lists entirely /obj/item/storage/belt/explorer/New() diff --git a/code/modules/samples/samples.dm b/code/modules/samples/samples.dm index 66c62f285a..b2185f9d28 100644 --- a/code/modules/samples/samples.dm +++ b/code/modules/samples/samples.dm @@ -193,9 +193,13 @@ if(istype(P, /obj/item/storage/sample_container)) var/obj/item/storage/sample_container/SC = P - src.loc = SC - SC.update_icon() - to_chat(user, span_notice("You store \the [src] in \the [SC].")) + if(SC.contents.len >= SC.max_storage_space) + to_chat(user, span_notice("\The [SC] is full!")) + return + else + src.loc = SC + SC.update_icon() + to_chat(user, span_notice("You store \the [src] in \the [SC].")) if(istype(P, /obj/item/cataloguer)) to_chat(user, span_notice("You start to scan \the [src] with \the [P]..."))