Fixes the syndie multitool tech origin, adds unit test for origin tech (#19729)

* fixes the syndie multitool tech origin, I am god

* someone didn't know how origin_tech worked heh

* I dunno what this is but AA wanted it

* Revert "I dunno what this is but AA wanted it"

This reverts commit 073dc5b8b5.

* maybe this-a-work?

* Revert "maybe this-a-work?"

This reverts commit 6b9b4a43a1.

* Affected Arc, more like Affected Arc

* WILL, THIS, WORK?

* amogus

* I'm a genius

* Warriorstar request
This commit is contained in:
Coolrune206
2022-11-25 07:47:24 +10:00
committed by GitHub
parent db6b994911
commit c4a9044ad3
3 changed files with 14 additions and 1 deletions
+1
View File
@@ -11,6 +11,7 @@
#include "log_format.dm"
#include "map_templates.dm"
#include "map_tests.dm"
#include "origin_tech.dm"
#include "purchase_reference_test.dm"
#include "reagent_id_typos.dm"
#include "rustg_version.dm"
+12
View File
@@ -0,0 +1,12 @@
// Unit test to ensure people have appropriately set up their origin_techs in items, ensuring they give the appropriate resources in RnD breakdown
/datum/unit_test/origin_tech/Run()
var/regex/nums = regex("^\[0-9]+")
for(var/tpath in subtypesof(/obj/item))
var/obj/item/I = tpath
var/tech_str = initial(I.origin_tech)
var/list/tech_list = params2list(tech_str)
for(var/k in tech_list)
if(length(nums.Replace(tech_list[k], "")) > 0)
Fail("Invalid origin tech for [tpath]: [tech_str]")