[MIRROR] Forbid ReagentIDs As Reagent Names (#12379)

Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-02-06 07:57:48 -07:00
committed by GitHub
parent 71677c90a3
commit b8e68006dc
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -911,7 +911,7 @@
industrial_use = REFINERYEXPORT_REASON_PRECURSOR
/datum/reagent/nutriment/pitcher_nectar //Pitcher plant reagent, doubles plant growth speed.
name = REAGENT_ID_PITCHERNECTAR
name = REAGENT_PITCHERNECTAR
id = REAGENT_ID_PITCHERNECTAR
description = "An odd, sticky slurry which promotes rapid plant growth."
taste_description = "pineapple"
+5
View File
@@ -10,6 +10,8 @@
/datum/unit_test/reagent_shall_have_unique_name_and_id/Run()
var/collection_name = list()
var/collection_id = list()
var/regex/name_legal = regex(@"[_\t\r\n]")
var/regex/id_legal = regex(@"[\s\t\r\n]")
for(var/Rpath in subtypesof(/datum/reagent))
var/datum/reagent/R = new Rpath()
@@ -21,6 +23,9 @@
TEST_ASSERT_NOTEQUAL(R.id, REAGENT_ID_DEVELOPER_WARNING, "[Rpath]: Reagents - reagent ID not set.")
TEST_ASSERT_NOTEQUAL(R.description, REAGENT_DESC_DEVELOPER_WARNING, "[Rpath]: Reagents - reagent description unset.")
TEST_ASSERT(!name_legal.Find(R.name), "[Rpath]: Reagents - reagent name contains illegal characters: [R.name].")
TEST_ASSERT(!id_legal.Find(R.id), "[Rpath]: Reagents - reagent id contains illegal characters or spaces: [R.id].")
TEST_ASSERT(R.id != "", "[Rpath]: Reagents - reagent ID blank.")
TEST_ASSERT_EQUAL(R.id, lowertext(R.id), "[Rpath]: Reagents - Reagent ID must be all lowercase.")