mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-30 07:28:53 +01:00
Mech construction fix and unittest (#18849)
* these need to be vars apparently * testing * spawn construct * macro fix * as anything * allow null... * consistency
This commit is contained in:
@@ -91,6 +91,7 @@
|
||||
#include "autowiki.dm"
|
||||
//#include "clothing_tests.dm" // FIXME
|
||||
#include "component_tests.dm"
|
||||
#include "construction_tests.dm"
|
||||
#include "cosmetic_tests.dm"
|
||||
#include "dcs_check_list_arguments.dm"
|
||||
#include "dcs_get_id_from_elements.dm"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/datum/unit_test/mech_construction/Run()
|
||||
var/failed = FALSE
|
||||
for(var/datum/construction/C as anything in subtypesof(/datum/construction))
|
||||
// We check for null, as null is legal here... For now... Mech construction needs a full refactor to make them unittest-able in a not ugly way.
|
||||
if(!C.result)
|
||||
continue
|
||||
if(!ispath(C.result))
|
||||
TEST_NOTICE(src, "[C.type]: Mech Construction - Had invalid result \"[C.result]\", must be a path.")
|
||||
failed = TRUE
|
||||
if(failed)
|
||||
TEST_FAIL("Mech Construction - A construction datum had incorrect data.")
|
||||
@@ -112,7 +112,8 @@
|
||||
while(S.cores)
|
||||
playsound(src, 'sound/machines/juicer.ogg', 25, 1)
|
||||
if(do_after(user, 15, target = src))
|
||||
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HARVEST_SLIME_CORE, new S.coretype(get_turf(AM)))
|
||||
var/atom/new_core = new S.coretype(get_turf(AM))
|
||||
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HARVEST_SLIME_CORE, new_core)
|
||||
playsound(src, 'sound/effects/splat.ogg', 50, 1)
|
||||
S.cores--
|
||||
qdel(S)
|
||||
|
||||
@@ -82,7 +82,8 @@
|
||||
if(istype(AM, /mob/living/simple_mob/slime))
|
||||
var/mob/living/simple_mob/slime/S = AM
|
||||
while(S.cores)
|
||||
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HARVEST_SLIME_CORE, new S.coretype(get_turf(src)))
|
||||
var/atom/new_core = new S.coretype(get_turf(src))
|
||||
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_HARVEST_SLIME_CORE, new_core)
|
||||
playsound(src, 'sound/effects/splat.ogg', 50, 1)
|
||||
S.cores--
|
||||
sleep(1 SECOND)
|
||||
|
||||
Reference in New Issue
Block a user