From c35db5de08bd66530475316b4f3dffb2b27ff0f4 Mon Sep 17 00:00:00 2001 From: SigDoesCode <84544997+SigDoesCode@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:10:58 -0700 Subject: [PATCH] Sanity exploit fixing (#59) ## About The Pull Request
Prevents players from injecting water and nutriment into food items with syringes. This behaviour was involved in an infinite sanity/insight exploit that allowed massive powerleveling. Players who attempt to inject water or nutriment into food items will be met with a line of text reading "Adding [reagent] to [the food] seems like it would ruin it." and no reagents from the syringe will be added. Other reagents, including poisons, toxins, tar, and medicines, can be added. This will make the exploit a LOT harder or remove it entirely. Additionally, fixed Individual Objectives providing a level up one minute after completing objectives, allowing for massive powerleveling. Objectives will now reward around 25 insight only.

## Changelog --- .../individual_objective/individual_objective.dm | 2 +- .../reagents/reagent_containers/syringes.dm | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/code/datums/objective/individual_objective/individual_objective.dm b/code/datums/objective/individual_objective/individual_objective.dm index 8681c13ee9c..6eeb7970abe 100644 --- a/code/datums/objective/individual_objective/individual_objective.dm +++ b/code/datums/objective/individual_objective/individual_objective.dm @@ -65,7 +65,7 @@ update_faction_score() to_chat(owner, SPAN_NOTICE("You have completed the personal objective: [name]")) H.sanity.give_insight(insight_reward) - H.sanity.finish_rest() + //H.sanity.finish_rest() //Uncommenting this line causes anyone to gain a level one minute after they finish the personal objective. Please. Please do not release this. /datum/individual_objective/proc/get_description() var/n_desc = desc diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 851a692542b..464cce52266 100755 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -225,6 +225,20 @@ to_chat(user, "Your amateur actions caused you [pain > 50 ? "a lot of " : ""]pain.") else to_chat(target, SPAN_NOTICE("You feel a tiny prick!")) + if(istype(target, /obj/item/reagent_containers/food/snacks)) + var/cheesecheck = FALSE + var/blamereagent + var/list/blacklistedreagents = list("water", "nutriment") + for(var/datum/reagent/R in src.reagents.reagent_list) + if(R.id in blacklistedreagents) + cheesecheck = TRUE + blamereagent = R.id + continue + if(cheesecheck) + to_chat(user, "Adding [blamereagent] to [target] seems like it would ruin it.") + return + else + trans = reagents.trans_to(target, amount_per_transfer_from_this) else trans = reagents.trans_to(target, amount_per_transfer_from_this) to_chat(user, SPAN_NOTICE("You inject [trans] units of the solution. [src] now contains [src.reagents.total_volume] units."))