mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 06:40:08 +01:00
[MIRROR] Recycler hotfix 1 (#10795)
Co-authored-by: eghughguhhhhhh <Hawoogabooga@gmail.com>
This commit is contained in:
co-authored by
eghughguhhhhhh
parent
35ae8bb470
commit
da31fd3b5c
@@ -0,0 +1,30 @@
|
||||
/datum/unit_test/recycler_vendor_entry_invalid
|
||||
name = "RECYCLER: Recycler Vendor Entry shall have valid definitions"
|
||||
|
||||
/datum/unit_test/recycler_vendor_entry_invalid/start_test()
|
||||
var/failed = FALSE
|
||||
|
||||
|
||||
|
||||
for(var/datum/maint_recycler_vendor_entry/R in subtypesof(/datum/maint_recycler_vendor_entry))
|
||||
var/item_to_spawn = initial(R.object_type_to_spawn)
|
||||
var/item_cost = initial(R.item_cost)
|
||||
var/global_item_cap = initial(R.per_round_cap)
|
||||
var/individual_item_cap = initial(R.per_person_cap)
|
||||
var/is_scam = initial(R.is_scam)
|
||||
if(!item_to_spawn && !is_scam)
|
||||
log_unit_test("[R] : Vendor Entry - Missing Object Type on non-scam entry")
|
||||
failed = TRUE
|
||||
if(item_cost < 0)
|
||||
log_unit_test("[R] : Vendor Entry - Negative Cost")
|
||||
failed = TRUE
|
||||
if((item_cost == 0) && ((global_item_cap < 0)&&(individual_item_cap < 0))) //nobody SHOULD set the cost to 0 but it's possible i guess. maybe for future scams
|
||||
log_unit_test("[R] : Vendor Entry - Infinite Item Spawning due to no individual or global item cap")
|
||||
failed = TRUE
|
||||
|
||||
if(failed)
|
||||
fail("One or more /datum/maint_recycler_vendor_entry had invalid results or definitions.")
|
||||
else
|
||||
pass("All /datum/maint_recycler_vendor_entry subtypes had correct settings.")
|
||||
|
||||
return TRUE
|
||||
Reference in New Issue
Block a user