mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Fix issues discovered via TypeMaker (#87596)
## About The Pull Request Fixes issues with var typing and proc arguments, discovered using OpenDream's WIP TypeMaker feature (using improvements I haven't PR'd upstream yet). ## Why It's Good For The Game Codebase maintenance.
This commit is contained in:
@@ -6,19 +6,19 @@
|
||||
/datum/unit_test/orderable_items/Run()
|
||||
var/list/all_paths = list()
|
||||
for (var/datum/orderable_item/orderable_item as anything in subtypesof(/datum/orderable_item))
|
||||
if(isnull(initial(orderable_item.item_path))) // don't check if they're not actual orderable items
|
||||
if(isnull(initial(orderable_item.purchase_path))) // don't check if they're not actual orderable items
|
||||
continue
|
||||
if (!isnull(initial(orderable_item.desc))) //don't check if they have a custom description
|
||||
continue
|
||||
|
||||
var/item_path = initial(orderable_item.item_path)
|
||||
var/purchase_path = initial(orderable_item.purchase_path)
|
||||
|
||||
var/obj/item/item_instance = allocate(item_path)
|
||||
var/obj/item/item_instance = allocate(purchase_path)
|
||||
var/initial_desc = initial(item_instance.desc)
|
||||
|
||||
if(item_path in all_paths)
|
||||
if(purchase_path in all_paths)
|
||||
TEST_FAIL("[orderable_item] is purchasable under two different orderable_item types,")
|
||||
all_paths += item_path
|
||||
all_paths += purchase_path
|
||||
|
||||
if (item_instance.desc != initial_desc)
|
||||
TEST_FAIL("[orderable_item] has an item ([item_path]) that has a dynamic description. [item_instance.desc] (dynamic description) != [initial_desc] (initial description)")
|
||||
TEST_FAIL("[orderable_item] has a product ([purchase_path]) that has a dynamic description. [item_instance.desc] (dynamic description) != [initial_desc] (initial description)")
|
||||
|
||||
Reference in New Issue
Block a user