mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-21 20:14:31 +01:00
Unit Test rework & Master/Ticker update (#17912)
* Unit Test rework & Master/Ticker update * Fixes and working unit testing * Fixes * Test fixes and FA update * Fixed runtimes * Radio subsystem * move that glob wherever later * ident * CIBUILDING compile option * Fixed runtimes * Some changes to the workflow * CI Split * More split * Pathing * Linters and Annotators * ci dir fix * Missing undef fixed * Enable grep checks * More test conversions * More split * Correct file * Removes unneeded inputs * oop * More dependency changes * More conversions * Conversion fixes * Fixes * Some assert fixes * Corrects start gate * Converted some README.dms to README.mds * Removes duplicate proc * Removes unused defines * Example configs * fix dll access viol by double calling * Post-rebase fixes * Cleans up names global list * Undef restart counter * More code/game/ cleanup * Statpanel update * Skybox * add * Fix ticker * Roundend fix * Persistence dependency update * Reordering * Reordering * Reordering * Initstage fix * . * . * Reorder * Reorder * Circle * Mobs * Air * Test fix * CI Script Fix * Configs * More ticker stuff * This is now in 'reboot world' * Restart world announcements * no glob in PreInit * to define * Update * Removed old include * Make this file normal again * moved * test * shared unit testing objects * Updates batched_spritesheets and universal_icon * . * job data debug * rm that * init order * show us * . * i wonder * . * . * urg * do we not have a job ID? * . * rm sleep for now * updated rust-g linux binaries * binaries update 2 * binaries update 3 * testing something * change that * test something * . * . * . * locavar * test * move that * . * debug * don't run this test * strack trace it * cleaner * . * . * cras again * also comment this out * return to official rust g * Update robot_icons.dm * monitor the generation * . --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
|
||||
//Wrapper procs that handle sanity and user feedback
|
||||
/atom/movable/proc/user_buckle_mob(mob/living/M, mob/user, var/forced = FALSE, var/silent = FALSE)
|
||||
if(!ticker)
|
||||
if(!SSticker)
|
||||
to_chat(user, span_warning("You can't buckle anyone in before the game starts."))
|
||||
return FALSE // Is this really needed?
|
||||
if(!user.Adjacent(M) || user.restrained() || user.stat || ispAI(user))
|
||||
|
||||
@@ -268,3 +268,13 @@
|
||||
. = ..()
|
||||
new /obj/item/clothing/mask/gas/sexymime(src.loc)
|
||||
new /obj/item/clothing/under/sexymime(src.loc)
|
||||
|
||||
/// Marks the bottom left of the testing zone.
|
||||
/// In landmarks.dm and not unit_test.dm so it is always active in the mapping tools.
|
||||
/obj/effect/landmark/unit_test_bottom_left
|
||||
name = "unit test zone bottom left"
|
||||
|
||||
/// Marks the top right of the testing zone.
|
||||
/// In landmarks.dm and not unit_test.dm so it is always active in the mapping tools.
|
||||
/obj/effect/landmark/unit_test_top_right
|
||||
name = "unit test zone top right"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
if(LAZYLEN(iterated_turfs) && iterated_turfs.len > total_turf_memory)
|
||||
iterated_turfs.Cut(total_turf_memory + 1)
|
||||
|
||||
for(var/direction in list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) - turn(src.dir,180))
|
||||
for(var/direction in GLOB.alldirs - turn(src.dir,180))
|
||||
var/turf/T = get_step(src, direction)
|
||||
if(T in iterated_turfs)
|
||||
continue
|
||||
|
||||
@@ -904,7 +904,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
|
||||
// testing("[src] (\ref[src]) - Slot: [slot_name], Inhands: [inhands], Worn Icon:[icon2use], Worn State:[state2use], Worn Layer:[layer2use]")
|
||||
// Send icon data to unit test when it is running, hello old testing(). I'm like, your great great grandkid! THE FUTURE IS NOW OLD MAN!
|
||||
#ifdef UNIT_TEST
|
||||
#ifdef UNIT_TESTS
|
||||
var/mob/living/carbon/human/H = loc
|
||||
if(ishuman(H))
|
||||
SEND_SIGNAL(H, COMSIG_UNITTEST_DATA, list("set_slot",slot_name,icon2use,state2use,inhands,type,H.species?.name))
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
set name = "Text Communicator"
|
||||
set desc = "If there is a communicator available, send a text message to it."
|
||||
|
||||
if(ticker.current_state < GAME_STATE_PLAYING)
|
||||
if(SSticker.current_state < GAME_STATE_PLAYING)
|
||||
to_chat(src, span_danger("The game hasn't started yet!"))
|
||||
return
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
set name = "Call Communicator"
|
||||
set desc = "If there is a communicator available, send a request to speak through it. This will reset your respawn timer, if someone picks up."
|
||||
|
||||
if(ticker.current_state < GAME_STATE_PLAYING)
|
||||
if(SSticker.current_state < GAME_STATE_PLAYING)
|
||||
to_chat(src, span_danger("The game hasn't started yet!"))
|
||||
return
|
||||
|
||||
|
||||
@@ -502,7 +502,7 @@
|
||||
if(has_channel_access(card.pai, internal_chan))
|
||||
channels += ch_name
|
||||
channels[ch_name] = 1
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
/obj/item/paicard/typeb
|
||||
name = "personal AI device"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
//..()
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
if(((ishuman(usr) && ((!( ticker ) || (ticker && ticker.mode != "monkey")) && usr.contents.Find(src))) || (usr.contents.Find(master) || (in_range(src, usr) && istype(loc, /turf)))))
|
||||
if(((ishuman(usr) && ((!( SSticker ) || (SSticker && SSticker.mode != "monkey")) && usr.contents.Find(src))) || (usr.contents.Find(master) || (in_range(src, usr) && istype(loc, /turf)))))
|
||||
usr.set_machine(src)
|
||||
if(href_list["freq"])
|
||||
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
|
||||
for(var/ch_name in channels)
|
||||
radio_controller.remove_object(src, radiochannels[ch_name])
|
||||
SSradio.remove_object(src, radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
@@ -183,15 +183,15 @@
|
||||
/obj/item/radio/headset/proc/handle_finalize_recalculatechannels(var/setDescription = FALSE, var/initial_run = FALSE)
|
||||
PRIVATE_PROC(TRUE)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if(!radio_controller && initial_run)
|
||||
if(!SSradio && initial_run)
|
||||
addtimer(CALLBACK(src,PROC_REF(handle_finalize_recalculatechannels),setDescription, FALSE),3 SECONDS)
|
||||
return
|
||||
if(!radio_controller && !initial_run)
|
||||
if(!SSradio && !initial_run)
|
||||
name = "broken radio headset"
|
||||
return
|
||||
|
||||
for (var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
if(setDescription)
|
||||
setupRadioDescription()
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
var/list/datum/radio_frequency/secure_radio_connections
|
||||
|
||||
/obj/item/radio/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
/obj/item/radio/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -57,7 +57,7 @@
|
||||
set_frequency(frequency)
|
||||
|
||||
for (var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
wires = new(src)
|
||||
internal_channels = GLOB.default_internal_channels.Copy()
|
||||
@@ -106,10 +106,10 @@
|
||||
qdel(wires)
|
||||
wires = null
|
||||
GLOB.listening_objects -= src
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
for (var/ch_name in channels)
|
||||
radio_controller.remove_object(src, radiochannels[ch_name])
|
||||
SSradio.remove_object(src, radiochannels[ch_name])
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/proc/recalculateChannels()
|
||||
@@ -649,7 +649,7 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
|
||||
|
||||
|
||||
for(var/ch_name in channels)
|
||||
radio_controller.remove_object(src, radiochannels[ch_name])
|
||||
SSradio.remove_object(src, radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
@@ -707,24 +707,24 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
|
||||
/obj/item/radio/borg/proc/controller_check(var/initial_run = FALSE)
|
||||
PRIVATE_PROC(TRUE)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if(!radio_controller && initial_run)
|
||||
if(!SSradio && initial_run)
|
||||
addtimer(CALLBACK(src,PROC_REF(controller_check), FALSE),3 SECONDS)
|
||||
return
|
||||
if(!radio_controller && !initial_run)
|
||||
if(!SSradio && !initial_run)
|
||||
name = "broken radio headset"
|
||||
return
|
||||
for (var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
/obj/item/radio/proc/config(op)
|
||||
if(radio_controller)
|
||||
if(SSradio)
|
||||
for (var/ch_name in channels)
|
||||
radio_controller.remove_object(src, radiochannels[ch_name])
|
||||
SSradio.remove_object(src, radiochannels[ch_name])
|
||||
secure_radio_connections = new
|
||||
channels = op
|
||||
if(radio_controller)
|
||||
if(SSradio)
|
||||
for (var/ch_name in op)
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
return
|
||||
|
||||
/obj/item/radio/off
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
return FALSE
|
||||
|
||||
/obj/effect/wingrille_spawn/Initialize(mapload)
|
||||
if(win_path && ticker && ticker.current_state < GAME_STATE_PLAYING)
|
||||
if(win_path && SSticker && SSticker.current_state < GAME_STATE_PLAYING)
|
||||
activate()
|
||||
..()
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/// Code (OBJECTS) in here gets used by the unit tests, but also regular code to test specific things.
|
||||
/// But because unit_tests are rather late in the loading order, we have to put objects that get shared in here.
|
||||
/// Else OpenDream gets very angry.
|
||||
|
||||
// Used to test distillations without hacking the other machinery's code up
|
||||
/obj/distilling_tester
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "cartridge"
|
||||
var/datum/gas_mixture/GM = new()
|
||||
var/current_temp = 0
|
||||
|
||||
/obj/distilling_tester/Initialize(mapload)
|
||||
create_reagents(5000,/datum/reagents/distilling)
|
||||
. = ..()
|
||||
|
||||
/obj/distilling_tester/return_air()
|
||||
return GM
|
||||
|
||||
/obj/distilling_tester/proc/test_distilling(var/decl/chemical_reaction/distilling/D, var/temp_prog)
|
||||
qdel_swap(GM,new())
|
||||
if(D.require_xgm_gas)
|
||||
GM.gas[D.require_xgm_gas] = 100
|
||||
else
|
||||
if(D.rejects_xgm_gas == GAS_N2)
|
||||
GM.gas[GAS_O2] = 100
|
||||
else
|
||||
GM.gas[GAS_N2] = 100
|
||||
if(D.minimum_xgm_pressure)
|
||||
GM.temperature = (D.minimum_xgm_pressure * CELL_VOLUME) / (GM.gas[D.require_xgm_gas] * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
// Try this 10 times, We need to know if something is blocking at multiple temps.
|
||||
// If it passes unit test, it might still be awful to make though, gotta find the right gas mix!
|
||||
current_temp = LERP( D.temp_range[1], D.temp_range[2], temp_prog)
|
||||
reagents.handle_reactions()
|
||||
|
||||
/obj/distilling_tester/Destroy(force, ...)
|
||||
qdel_null(GM)
|
||||
. = ..()
|
||||
Reference in New Issue
Block a user