From 351e2dc866b441d6d9945f2955bbdb4c8a614dd4 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 18:08:39 +0100 Subject: [PATCH 01/26] the od linter --- .github/workflows/ci_suite.yml | 13 +++++++++++++ code/__odlint.dm | 11 +++++++++++ colonialmarines.dme | 1 + tools/ci/lints.dm | 27 +++++++++++++++++++++++++++ tools/ci/run_od.sh | 3 +++ tools/ci/setup_od.sh | 8 ++++++++ tools/ci/validate_dme.py | 3 +++ 7 files changed, 66 insertions(+) create mode 100644 code/__odlint.dm create mode 100644 tools/ci/lints.dm create mode 100644 tools/ci/run_od.sh create mode 100644 tools/ci/setup_od.sh diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index 683f3909b447..68c6eb4de756 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -60,6 +60,19 @@ jobs: with: outputFile: output-annotations.txt + + odlint: + name: Lint with OpenDream + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Setup OD + run: | + bash tools/ci/setup_od.sh + - name: Run OD + run: | + bash tools/ci/run_od.sh + compile_all_maps: if: "!contains(github.event.head_commit.message, '[ci skip]')" name: Compile Maps diff --git a/code/__odlint.dm b/code/__odlint.dm new file mode 100644 index 000000000000..47301d6cf7bd --- /dev/null +++ b/code/__odlint.dm @@ -0,0 +1,11 @@ +// This file is included right at the start of the DME. +// Its purpose is to enable multiple lints (pragmas) that are supported by OpenDream to better validate the codebase +// These are essentially nitpicks the DM compiler should pick up on but doesnt + +#ifndef SPACEMAN_DMM +#ifdef OPENDREAM +// These are in their own file as you need to do it with an include as a hack to avoid +// SpacemanDMM evaluating the #pragma lines, even if its outside a block it cares about +#include "tools/ci/lints.dm" +#endif +#endif diff --git a/colonialmarines.dme b/colonialmarines.dme index 63140be5e458..88f4acfff7de 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -11,6 +11,7 @@ s// DM Environment file for colonialmarines.dme. #define DEBUG // END_PREFERENCES // BEGIN_INCLUDE +#include "code\__odlint.dm" #include "code\_byond_version_compat.dm" #include "code\_compile_options.dm" #include "code\_experiments.dm" diff --git a/tools/ci/lints.dm b/tools/ci/lints.dm new file mode 100644 index 000000000000..39c14e1bbc95 --- /dev/null +++ b/tools/ci/lints.dm @@ -0,0 +1,27 @@ +//1000-1999 +#pragma FileAlreadyIncluded error +#pragma MissingIncludedFile error +#pragma MisplacedDirective error +#pragma UndefineMissingDirective error +#pragma DefinedMissingParen error +#pragma ErrorDirective error +#pragma WarningDirective error +#pragma MiscapitalizedDirective error + +//2000-2999 +#pragma SoftReservedKeyword error +#pragma DuplicateVariable error +#pragma DuplicateProcDefinition error +#pragma TooManyArguments error +#pragma PointlessParentCall error +#pragma PointlessBuiltinCall error +#pragma SuspiciousMatrixCall error +#pragma MalformedRange error +#pragma InvalidRange error +#pragma InvalidSetStatement error +#pragma InvalidOverride error +#pragma DanglingVarType error +#pragma MissingInterpolatedExpression error + +//3000-3999 +#pragma EmptyBlock error diff --git a/tools/ci/run_od.sh b/tools/ci/run_od.sh new file mode 100644 index 000000000000..fa7438568fb1 --- /dev/null +++ b/tools/ci/run_od.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -eo pipefail +dotnet OpenDream/DMCompiler/bin/Release/net7.0/DMCompiler.dll --suppress-unimplemented colonialmarines.dme diff --git a/tools/ci/setup_od.sh b/tools/ci/setup_od.sh new file mode 100644 index 000000000000..aad45f2bc971 --- /dev/null +++ b/tools/ci/setup_od.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -eo pipefail + +git clone https://github.com/OpenDreamProject/OpenDream.git OpenDream +cd OpenDream +git submodule update --init --recursive +dotnet restore +dotnet build -c Release diff --git a/tools/ci/validate_dme.py b/tools/ci/validate_dme.py index 33066f72e75e..03136949ae0c 100644 --- a/tools/ci/validate_dme.py +++ b/tools/ci/validate_dme.py @@ -17,6 +17,9 @@ # Included by BSQL/includes.dm r'code/__HELPERS/BSQL/**/*.dm', + + # Included as part of OD lints + r'tools/ci/lints.dm' ] lines = [] From 2357f95465ae5b15defe5841550ff938cd3523ee Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 18:13:47 +0100 Subject: [PATCH 02/26] pragmas too --- code/__odlint.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__odlint.dm b/code/__odlint.dm index 47301d6cf7bd..6474ad77420e 100644 --- a/code/__odlint.dm +++ b/code/__odlint.dm @@ -6,6 +6,6 @@ #ifdef OPENDREAM // These are in their own file as you need to do it with an include as a hack to avoid // SpacemanDMM evaluating the #pragma lines, even if its outside a block it cares about -#include "tools/ci/lints.dm" +#include "../tools/ci/lints.dm" #endif #endif From aefe1f6c78aeaeabdb5179a5f85af2f9a7f8312f Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 18:28:33 +0100 Subject: [PATCH 03/26] fixes some and enables pragmas --- code/_byond_version_compat.dm | 2 +- code/_compile_options.dm | 2 +- code/controllers/subsystem/vote.dm | 2 +- code/game/machinery/computer/skills.dm | 43 +++++++++---------- code/game/objects/items/stacks/nanopaste.dm | 2 +- .../objects/items/storage/large_holster.dm | 2 +- .../objects/structures/barricade/barricade.dm | 2 +- .../objects/structures/barricade/handrail.dm | 2 +- code/modules/asset_cache/asset_list_items.dm | 2 +- code/modules/clothing/suits/armor.dm | 2 +- 10 files changed, 29 insertions(+), 32 deletions(-) diff --git a/code/_byond_version_compat.dm b/code/_byond_version_compat.dm index 719d85654b5f..26968f0f837c 100644 --- a/code/_byond_version_compat.dm +++ b/code/_byond_version_compat.dm @@ -3,7 +3,7 @@ //Update this whenever you need to take advantage of more recent byond features #define MIN_COMPILER_VERSION 514 #define MIN_COMPILER_BUILD 1588 -#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM) +#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM) && !defined(OPENDREAM) //Don't forget to update this part #error Your version of BYOND is too out-of-date to compile this project. Go to https://secure.byond.com/download and update. #error You need version 514.1588 or higher diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 0f81b0173ac1..20aa2081318c 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -30,7 +30,7 @@ #define CBT #endif -#if !defined(CBT) && !defined(SPACEMAN_DMM) +#if !defined(CBT) && !defined(SPACEMAN_DMM) && !defined(OPENDREAM) #warn Building with Dream Maker is no longer supported and will result in errors. #warn In order to build, run BUILD.bat in the bin directory. #warn Consider switching to VSCode editor instead, where you can press Ctrl+Shift+B to build. diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 3882228a5ab1..a56e10636a1e 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -273,7 +273,7 @@ SUBSYSTEM_DEF(vote) question = "Gamemode vote" randomize_entries = TRUE for(var/mode_type in config.gamemode_cache) - var/datum/game_mode/M = initial(mode_type) + var/datum/game_mode/M = mode_type if(initial(M.config_tag)) var/vote_cycle_met = !initial(M.vote_cycle) || (text2num(SSperf_logging?.round?.id) % initial(M.vote_cycle) == 0) if(initial(M.votable) && vote_cycle_met) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index f891d46bc36b..f2540ad8ea4a 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -43,16 +43,16 @@ var/dat if (temp) - dat = text("[]

Clear Screen", temp, src) + dat = "[temp]

Clear Screen" else - dat = text("Confirm Identity: []
", src, (scan ? text("[]", scan.name) : "----------")) + dat = "Confirm Identity: [scan ? scan.name : "----------"]
" if (authenticated) switch(screen) if(1.0) dat += {"

"} - dat += text("Search Records
", src) - dat += text("New Record
", src) + dat += "Search Records
" + dat += "New Record
" dat += {"

@@ -70,20 +70,19 @@ if(!isnull(GLOB.data_core.general)) for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) for(var/datum/data/record/E in GLOB.data_core.security) - var/background - dat += text("", background, src, R, R.fields["name"]) - dat += text("", R.fields["id"]) - dat += text("", R.fields["rank"]) + dat += "" + dat += "" + dat += "" dat += "
[][][]
[R.fields["name"]][R.fields["id"]][R.fields["rank"]]

" - dat += text("Record Maintenance

", src) - dat += text("{Log Out}",src) + dat += "Record Maintenance

" + dat += "{Log Out}" if(2.0) dat += "Records Maintenance
" dat += "
Delete All Records

Back" if(3.0) dat += "
Employment Record

" if ((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1))) - dat += text("
\ + dat += " \
\ Name: [active1.fields["name"]]
\ ID: [active1.fields["id"]]
\n \ Sex: [active1.fields["sex"]]
\n \ @@ -93,18 +92,18 @@ Mental Status: [active1.fields["m_stat"]]

\n \ Employment/skills summary:
[decode(active1.fields["notes"])]
Photo:
\ -
") +
" else dat += "General Record Lost!
" - dat += text("\nDelete Record (ALL)

\nPrint Record
\nBack
", src, src, src) + dat += "\nDelete Record (ALL)

\nPrint Record
\nBack
" if(4.0) if(!Perp.len) - dat += text("ERROR. String could not be located.

Back", src) + dat += "ERROR. String could not be located.

Back" else dat += {" "} - dat += text("", tempname) + dat += "" dat += {"
Search Results for '[]':Search Results for '[tempname]':
@@ -121,17 +120,15 @@ if(istype(Perp[i+1],/datum/data/record/)) var/datum/data/record/E = Perp[i+1] crimstat = E.fields["criminal"] - var/background - background = "'background-color:#00FF7F;'" - dat += text("[]", background, src, R, R.fields["name"]) - dat += text("[]", R.fields["id"]) - dat += text("[]", R.fields["rank"]) - dat += text("[]", crimstat) + dat += "[R.fields["name"]]" + dat += "[R.fields["id"]]" + dat += "[R.fields["rank"]]" + dat += "[crimstat]" dat += "
" - dat += text("
Return to index.", src) + dat += "
Return to index." else else - dat += text("{Log In}", src) + dat += "{Log In}" show_browser(user, dat, "Employment Records", "secure_rec", "size=600x400") onclose(user, "secure_rec") return diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 32e9a030462e..754a36c6012a 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -40,7 +40,7 @@ H.pain.recalculate_pain() H.updatehealth() use(1) - var/others_msg = "\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"] [S.display_name] with \the [src]." // Needs to create vars for these messages because macro doesn't work otherwise + var/others_msg = "\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " the"] [S.display_name] with \the [src]." // Needs to create vars for these messages because macro doesn't work otherwise var/user_msg = "You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.display_name]." user.visible_message(SPAN_NOTICE("[others_msg]"),\ SPAN_NOTICE("[user_msg]")) diff --git a/code/game/objects/items/storage/large_holster.dm b/code/game/objects/items/storage/large_holster.dm index ef2bcfb7216a..b4a6c3a8c1af 100644 --- a/code/game/objects/items/storage/large_holster.dm +++ b/code/game/objects/items/storage/large_holster.dm @@ -326,7 +326,7 @@ /obj/item/storage/large_holster/fuelpack/get_examine_text(mob/user) . = ..() if(contents.len) - . += "It is storing \a M240-T incinerator unit." + . += "It is storing a M240-T incinerator unit." if (get_dist(user, src) <= 1) if(fuel) . += "The [fuel.caliber] currently contains: [round(fuel.get_ammo_percent())]% fuel." diff --git a/code/game/objects/structures/barricade/barricade.dm b/code/game/objects/structures/barricade/barricade.dm index 0ca2ccb1ddbc..5a72ec33ea2a 100644 --- a/code/game/objects/structures/barricade/barricade.dm +++ b/code/game/objects/structures/barricade/barricade.dm @@ -78,7 +78,7 @@ switch(dir) if(SOUTH) layer = ABOVE_MOB_LAYER - else if(NORTH) + if(NORTH) layer = initial(layer) - 0.01 else layer = initial(layer) diff --git a/code/game/objects/structures/barricade/handrail.dm b/code/game/objects/structures/barricade/handrail.dm index ea10dc7256de..ae166dbbf985 100644 --- a/code/game/objects/structures/barricade/handrail.dm +++ b/code/game/objects/structures/barricade/handrail.dm @@ -24,7 +24,7 @@ switch(dir) if(SOUTH) layer = ABOVE_MOB_LAYER - else if(NORTH) + if(NORTH) layer = initial(layer) - 0.01 else layer = initial(layer) diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm index d5d44a047947..d1e7f83dacb1 100644 --- a/code/modules/asset_cache/asset_list_items.dm +++ b/code/modules/asset_cache/asset_list_items.dm @@ -321,7 +321,7 @@ I = icon(icon_file, icon_state, SOUTH) var/c = initial(item.color) if (!isnull(c) && c != "#FFFFFF") - I.Blend(initial(c), ICON_MULTIPLY) + I.Blend(c, ICON_MULTIPLY) else if (ispath(k, /obj/effect/essentials_set)) var/obj/effect/essentials_set/es_set = new k() diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index d969587e32e5..cc7fee7724f4 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -423,7 +423,7 @@ return var/obj/item/weapon/gun/W = usr.get_active_hand() if (W.w_class > SIZE_MEDIUM) - to_chat(usr, SPAN_DANGER("This gun won't fit in \the belt!")) + to_chat(usr, SPAN_DANGER("This gun won't fit in the belt!")) return holstered = usr.get_active_hand() usr.drop_held_item() From 6cae28f3f2cbc24bdbee2ecd39e7d07d91d2ac1c Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:33:54 -0700 Subject: [PATCH 04/26] vending --- code/game/machinery/vending/vending.dm | 35 ++++++++++++-------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/code/game/machinery/vending/vending.dm b/code/game/machinery/vending/vending.dm index a74dd923cbe7..414ab4a562e1 100644 --- a/code/game/machinery/vending/vending.dm +++ b/code/game/machinery/vending/vending.dm @@ -398,28 +398,25 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending /obj/structure/machinery/vending/proc/GetProductIndex(datum/data/vending_product/product) var/list/plist - switch(product.category) - if(CAT_NORMAL) - plist=product_records - if(CAT_HIDDEN) - plist=hidden_records - if(CAT_COIN) - plist=coin_records - else - warning("UNKNOWN CATEGORY [product.category] IN TYPE [product.product_path] INSIDE [type]!") + if(product.category == CAT_NORMAL) + plist = product_records + else if(product.category == CAT_HIDDEN) + plist = hidden_records + else if(product.category == CAT_COIN) + plist = coin_records + else + warning("UNKNOWN CATEGORY [product.category] IN TYPE [product.product_path] INSIDE [type]!") return plist.Find(product) /obj/structure/machinery/vending/proc/GetProductByID(pid, category) - switch(category) - if(CAT_NORMAL) - return product_records[pid] - if(CAT_HIDDEN) - return hidden_records[pid] - if(CAT_COIN) - return coin_records[pid] - else - warning("UNKNOWN PRODUCT: PID: [pid], CAT: [category] INSIDE [type]!") - return null + if(category == CAT_NORMAL) + return product_records[pid] + else if(category == CAT_HIDDEN) + return hidden_records[pid] + else if(category == CAT_COIN) + return coin_records[pid] + else + warning("UNKNOWN PRODUCT: PID: [pid], CAT: [category] INSIDE [type]!") /obj/structure/machinery/vending/attack_hand(mob/user) if(is_tipped_over) From 08d74064edf0c00cf175cacf044b06f154284f17 Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:37:31 -0700 Subject: [PATCH 05/26] is this even correct??? --- code/modules/flufftext/Chinese.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/flufftext/Chinese.dm b/code/modules/flufftext/Chinese.dm index 36da1d307a5b..6b19dd61fcf5 100644 --- a/code/modules/flufftext/Chinese.dm +++ b/code/modules/flufftext/Chinese.dm @@ -62,12 +62,12 @@ //remove complex/simple -u- glide final_syllables if(initial.initial_sound_flags & SIMPLE_U_ONLY) for(var/datum/chinese_sound/final_syllable/final_syllable as anything in possible_final_syllables) - if(initial(initial(final_syllable.vowel_class)) == VOWEL_CLASS_BACK_CLOSE) + if(initial(final_syllable.vowel_class) == VOWEL_CLASS_BACK_CLOSE) possible_final_syllables -= final_syllable possible_final_syllables += /datum/chinese_sound/final_syllable/u else if(initial.initial_sound_flags & HALF_U) for(var/datum/chinese_sound/final_syllable/final_syllable as anything in possible_final_syllables) - if(initial(initial(final_syllable.vowel_class)) == VOWEL_CLASS_BACK_CLOSE && initial(final_syllable.final_syllable_sound_flags) & U_GROUP_FULL) + if(initial(final_syllable.vowel_class) == VOWEL_CLASS_BACK_CLOSE && initial(final_syllable.final_syllable_sound_flags) & U_GROUP_FULL) possible_final_syllables -= final_syllable //check for if the sound is alveolo-palatal or sibilant/retroflex - then remove or keep front close vowels accordingly From ad6dbf4ae21d34be01d696e942152ecbf606ad93 Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:41:34 -0700 Subject: [PATCH 06/26] empty branches --- .../crates_lockers/closets/utility_closets.dm | 3 - code/modules/admin/topic/topic.dm | 80 ------------------- code/modules/client/preferences.dm | 2 - .../modules/desert_dam/filtration/consoles.dm | 2 - code/modules/mob/living/carbon/human/say.dm | 1 - .../modules/projectiles/guns/flamer/flamer.dm | 2 - .../reagents/chemistry_reagents/drink.dm | 8 +- 7 files changed, 4 insertions(+), 94 deletions(-) diff --git a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm index 7848aaba4897..887a36115b8d 100644 --- a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm @@ -50,9 +50,6 @@ new /obj/item/tank/emergency_oxygen/engi(src) new /obj/item/clothing/mask/gas(src) new /obj/item/clothing/mask/gas(src) - new /obj/item/storage/firstaid/o2(src) - if ("nothing") - // doot // teehee - Ah, tg coders... if ("delete") diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index 31f99870fe43..bb13843bfc34 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -336,86 +336,6 @@ /////////////////////////////////////new ban stuff - else if(href_list["jobban2"]) -// if(!check_rights(R_BAN)) return - /* - var/mob/M = locate(href_list["jobban2"]) - if(!ismob(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - if(!M.ckey) //sanity - to_chat(usr, "This mob has no ckey") - return - if(!RoleAuthority) - to_chat(usr, "The Role Authority is not set up!") - return - - var/datum/entity/player/P = get_player_from_key(M.ckey) - - var/dat = "" - var/body - var/jobs = "" - - /***********************************WARNING!************************************ - The jobban stuff looks mangled and disgusting - But it looks beautiful in-game - -Nodrak - ************************************WARNING!***********************************/ -//Regular jobs - //Command (Blue) - jobs += generate_job_ban_list(M, ROLES_CIC, "CIC", "ddddff") - jobs += "
" - // SUPPORT - jobs += generate_job_ban_list(M, ROLES_AUXIL_SUPPORT, "Support", "ccccff") - jobs += "
" - // MPs - jobs += generate_job_ban_list(M, ROLES_POLICE, "Police", "ffdddd") - jobs += "
" - //Engineering (Yellow) - jobs += generate_job_ban_list(M, ROLES_ENGINEERING, "Engineering", "fff5cc") - jobs += "
" - //Cargo (Yellow) //Copy paste, yada, yada. Hopefully Snail can rework this in the future. - jobs += generate_job_ban_list(M, ROLES_REQUISITION, "Requisition", "fff5cc") - jobs += "
" - //Medical (White) - jobs += generate_job_ban_list(M, ROLES_MEDICAL, "Medical", "ffeef0") - jobs += "
" - //Marines - jobs += generate_job_ban_list(M, ROLES_MARINES, "Marines", "ffeeee") - jobs += "
" - // MISC - jobs += generate_job_ban_list(M, ROLES_MISC, "Misc", "aaee55") - jobs += "
" - // Xenos (Orange) - jobs += generate_job_ban_list(M, ROLES_XENO, "Xenos", "a268b1") - jobs += "
" - //Extra (Orange) - var/isbanned_dept = jobban_isbanned(M, "Syndicate", P) - jobs += "" - jobs += "" - - //ERT - if(jobban_isbanned(M, "Emergency Response Team", P) || isbanned_dept) - jobs += "" - else - jobs += "" - - //Survivor - if(jobban_isbanned(M, "Survivor", P) || isbanned_dept) - jobs += "" - else - jobs += "" - - if(jobban_isbanned(M, "Agent", P) || isbanned_dept) - jobs += "" - else - jobs += "" - - body = "[jobs]" - dat = "[body]" - show_browser(usr, dat, "Job-Ban Panel: [M.name]", "jobban2", "size=800x490") - return*/ // DEPRECATED //JOBBAN'S INNARDS else if(href_list["jobban3"]) if(!check_rights(R_MOD,0) && !check_rights(R_ADMIN)) return diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 554ba28e417f..0caabbb57fb6 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1414,8 +1414,6 @@ var/const/MAX_SAVE_SLOTS = 10 for(var/i=1, i<=length(new_xeno_prefix), i++) var/ascii_char = text2ascii(new_xeno_prefix,i) switch(ascii_char) - // A .. Z - if(65 to 90) //Uppercase Letters will work else all_ok = FALSE //everything else - won't if(all_ok) diff --git a/code/modules/desert_dam/filtration/consoles.dm b/code/modules/desert_dam/filtration/consoles.dm index 038b96eb4713..8c2814fafde7 100644 --- a/code/modules/desert_dam/filtration/consoles.dm +++ b/code/modules/desert_dam/filtration/consoles.dm @@ -35,8 +35,6 @@ var/global/river_activated = FALSE if (prob(10)) get_broken() return - else - return /obj/structure/machinery/filtration/console/proc/get_broken() if(damaged) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 4b86c827a069..069392f2c92e 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -132,7 +132,6 @@ for(var/message_mode in parsed["modes"]) var/list/obj/item/used_radios = list() switch(message_mode) - if(MESSAGE_MODE_LOCAL) if(RADIO_MODE_WHISPER) whisper_say(message, speaking, alt_name) return diff --git a/code/modules/projectiles/guns/flamer/flamer.dm b/code/modules/projectiles/guns/flamer/flamer.dm index 13ccd03c3e82..1091df3391b6 100644 --- a/code/modules/projectiles/guns/flamer/flamer.dm +++ b/code/modules/projectiles/guns/flamer/flamer.dm @@ -737,8 +737,6 @@ GLOBAL_LIST_EMPTY(flamer_particles) var/angle = 180 - abs( abs( direction_angle - spread_direction_angle ) - 180 ) // the angle difference between the spread direction and initial direction switch(angle) //this reduces power when the explosion is going around corners - if (0) - //no change if (45) spread_power *= 0.75 else //turns out angles greater than 90 degrees almost never happen. This bit also prevents trying to spread backwards diff --git a/code/modules/reagents/chemistry_reagents/drink.dm b/code/modules/reagents/chemistry_reagents/drink.dm index 468243a0cc8d..3bd7336c32b6 100644 --- a/code/modules/reagents/chemistry_reagents/drink.dm +++ b/code/modules/reagents/chemistry_reagents/drink.dm @@ -85,13 +85,13 @@ /datum/reagent/drink/carrotjuice/on_mob_life(mob/living/M) . = ..() - if(!.) return + if(!.) + return M.ReduceEyeBlur(1) M.ReduceEyeBlind(1) - if(!data) data = 1 + if(!data) + data = 1 switch(data) - if(1 to 20) - //nothing if(21 to INFINITY) if(prob(data-10)) M.disabilities &= ~NEARSIGHTED From 9c29123365874fc7cf05ffdd7716b21f4dd25e69 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 18:47:43 +0100 Subject: [PATCH 07/26] s --- colonialmarines.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colonialmarines.dme b/colonialmarines.dme index 88f4acfff7de..5aaa405c2b90 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1,4 +1,4 @@ -s// DM Environment file for colonialmarines.dme. +// DM Environment file for colonialmarines.dme. // All manual changes should be made outside the BEGIN_ and END_ blocks. // New source code should be placed in .dm files: choose File/New --> Code File. // BEGIN_INTERNALS From 529dd85b7f88dfb481dba806ee0bfea7d840149b Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:48:43 -0700 Subject: [PATCH 08/26] more --- code/__HELPERS/type2type.dm | 5 +---- code/controllers/subsystem/atoms.dm | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 4e4a1b3ff31c..5d0d113b0c55 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -21,7 +21,7 @@ var/char = copytext(hex, i, i + 1) switch(char) if("0") - //Apparently, switch works with empty statements, yay! If that doesn't work, blame me, though. -- Urist + pass() if("9", "8", "7", "6", "5", "4", "3", "2", "1") num += text2num(char) * 16 ** power if("a", "A") @@ -77,7 +77,6 @@ hex += "E" if(15.0) hex += "F" - else power-- while(length(hex) < placeholder) hex = text("0[]", hex) @@ -165,8 +164,6 @@ return 6 if("SOUTHWEST") return 10 - else - return //Converts an angle (degrees) into an ss13 direction /proc/angle2dir(degree) diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index 23da8cc8c9eb..3d544dca1390 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -131,7 +131,7 @@ SUBSYSTEM_DEF(atoms) switch(result) if (INITIALIZE_HINT_NORMAL) - // pass + pass() if(INITIALIZE_HINT_LATELOAD) if(arguments[1]) //mapload late_loaders += A From a590883814877786a9201298a9bb22eed2d6dcb8 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 18:53:23 +0100 Subject: [PATCH 09/26] compile fail --- code/modules/client/preferences.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 0caabbb57fb6..7111e8ccdc42 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1413,9 +1413,8 @@ var/const/MAX_SAVE_SLOTS = 10 var/all_ok = TRUE for(var/i=1, i<=length(new_xeno_prefix), i++) var/ascii_char = text2ascii(new_xeno_prefix,i) - switch(ascii_char) - else - all_ok = FALSE //everything else - won't + if(ascii_char < 65 || ascii_char > 90) + all_ok = FALSE //everything else - won't if(all_ok) xeno_prefix = new_xeno_prefix else From 4194d5330cbb5962ffacb46616234ef59d4fc96d Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:10:55 +0100 Subject: [PATCH 10/26] tidy tidy --- code/__DEFINES/bullet_traits.dm | 2 +- code/game/machinery/computer/robot.dm | 3 +-- code/game/machinery/computer/skills.dm | 2 -- code/game/machinery/medical_pod/bodyscanner.dm | 4 ---- code/game/machinery/medical_pod/sleeper.dm | 1 - code/game/objects/explosion_recursive.dm | 2 +- 6 files changed, 3 insertions(+), 11 deletions(-) diff --git a/code/__DEFINES/bullet_traits.dm b/code/__DEFINES/bullet_traits.dm index 0ca3bce2e602..40e250cd0dd2 100644 --- a/code/__DEFINES/bullet_traits.dm +++ b/code/__DEFINES/bullet_traits.dm @@ -3,7 +3,7 @@ // list of args if there are any args /// An entry to a list for giving projectiles bullet traits /// Must be placed inside of a list -#define BULLET_TRAIT_ENTRY(trait, args...) trait = #args ? list(##args) : null +#define BULLET_TRAIT_ENTRY(trait, args...) trait = list(##args) /// An entry to a list for giving projectiles bullet traits with a unique ID /// Must be placed inside of a list #define BULLET_TRAIT_ENTRY_ID(id, trait, args...) id = list(trait, ##args) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 12f4faedc979..c5a13e2c3e74 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -55,8 +55,7 @@ dat += " Locked Down |" else dat += " Operating Normally |" - if (!R.canmove) - else if(R.cell) + if(R.canmove && R.cell) dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |" else dat += " No Cell Installed |" diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index f2540ad8ea4a..a20d344b53a9 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -126,7 +126,6 @@ dat += "" dat += "
Extras
Emergency Response TeamEmergency Response TeamSurvivorSurvivorAgentAgent[crimstat]

" dat += "
Return to index." - else else dat += "{Log In}" show_browser(user, dat, "Employment Records", "secure_rec", "size=600x400") @@ -339,7 +338,6 @@ What a mess.*/ if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"])) GLOB.data_core.medical -= R qdel(R) - else QDEL_NULL(active1) else temp = "This function does not appear to be working at the moment. Our apologies." diff --git a/code/game/machinery/medical_pod/bodyscanner.dm b/code/game/machinery/medical_pod/bodyscanner.dm index 4756121e50ae..fdcd0ceb62e6 100644 --- a/code/game/machinery/medical_pod/bodyscanner.dm +++ b/code/game/machinery/medical_pod/bodyscanner.dm @@ -62,8 +62,6 @@ if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY) deconstruct(FALSE) return - else - return #ifdef OBJECTS_PROXY_SPEECH // Transfers speech to occupant @@ -124,8 +122,6 @@ if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY) deconstruct(FALSE) return - else - return /obj/structure/machinery/body_scanconsole/power_change() ..() diff --git a/code/game/machinery/medical_pod/sleeper.dm b/code/game/machinery/medical_pod/sleeper.dm index 805fedb29257..35d9a44863d2 100644 --- a/code/game/machinery/medical_pod/sleeper.dm +++ b/code/game/machinery/medical_pod/sleeper.dm @@ -385,7 +385,6 @@ t1 = "Unconscious" if(2) t1 = "*dead*" - else to_chat(user, "[]\t Health %: [] ([])", (occupant.health > 50 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.health, t1) to_chat(user, "[]\t -Core Temperature: []°C ([]°F)
", (occupant.bodytemperature > 50 ? "" : ""), occupant.bodytemperature-T0C, occupant.bodytemperature*1.8-459.67) to_chat(user, "[]\t -Brute Damage %: []", (occupant.getBruteLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getBruteLoss()) diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index 1f52901c21a6..82566c80302f 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -149,7 +149,7 @@ explosion resistance exactly as much as their health switch(angle) //this reduces power when the explosion is going around corners if (0) - //no change + pass() if (45) if(spread_power >= 0) spread_power *= 0.75 From 722fe26229f8e410591f3e49ff7ce8cd8a89a7d5 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:26:11 +0100 Subject: [PATCH 11/26] lets do it like this --- .github/workflows/ci_suite.yml | 7 +++++++ dependencies.sh | 2 ++ tools/ci/setup_od.sh | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index 68c6eb4de756..00173f6f04cc 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -65,6 +65,13 @@ jobs: name: Lint with OpenDream runs-on: ubuntu-20.04 steps: + - name: Restore Yarn cache + uses: actions/cache@v3 + with: + path: OpenDream + key: ${{ runner.os }}-opendream-${{ hashFiles('dependencies.sh') }} + restore-keys: | + ${{ runner.os }}-opendream- - uses: actions/checkout@v3 - name: Setup OD run: | diff --git a/dependencies.sh b/dependencies.sh index 2889751d36e6..f88c2f9b0a4b 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -19,3 +19,5 @@ export SPACEMAN_DMM_VERSION=suite-1.7.2 # Python version for mapmerge and other tools export PYTHON_VERSION=3.7.9 + +export OPENDREAM_VERSION=0.2.0 diff --git a/tools/ci/setup_od.sh b/tools/ci/setup_od.sh index aad45f2bc971..d548b3d72fdf 100644 --- a/tools/ci/setup_od.sh +++ b/tools/ci/setup_od.sh @@ -1,8 +1,13 @@ #!/bin/bash set -eo pipefail +if [ -z "${OPENDREAM_VERSION+x}" ]; then + source dependencies.sh +fi + git clone https://github.com/OpenDreamProject/OpenDream.git OpenDream cd OpenDream +git checkout tags/v${OPENDREAM_VERSION} git submodule update --init --recursive dotnet restore dotnet build -c Release From 7975b036503bd68439273dec0d664078cec32bb3 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:29:00 +0100 Subject: [PATCH 12/26] uhh this aint yarn --- .github/workflows/ci_suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index 00173f6f04cc..59f4be260e94 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -65,7 +65,7 @@ jobs: name: Lint with OpenDream runs-on: ubuntu-20.04 steps: - - name: Restore Yarn cache + - name: Restore OpenDream cache uses: actions/cache@v3 with: path: OpenDream From 188dfe886f78933bfa29f51798ada68ecfefd812 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:38:40 +0100 Subject: [PATCH 13/26] alright --- code/datums/_ndatabase/code/brsql_adapter.dm | 4 ++-- code/datums/_ndatabase/code/native_adapter.dm | 3 +-- code/game/machinery/OpTable.dm | 2 -- code/game/machinery/air_alarm.dm | 2 -- code/game/machinery/bots/mulebot.dm | 2 +- code/game/machinery/computer/computer.dm | 2 -- code/game/machinery/computer/medical.dm | 7 ------- code/game/machinery/computer/pod.dm | 1 - code/game/machinery/deployable.dm | 1 - code/game/objects/effects/glowshroom.dm | 2 -- code/game/objects/items.dm | 1 - code/game/objects/items/reagent_containers/food/snacks.dm | 3 +-- code/game/objects/structures/bookcase.dm | 2 -- code/game/objects/structures/crates_lockers/crates.dm | 2 -- code/game/objects/structures/lattice.dm | 2 -- code/game/objects/structures/reagent_dispensers.dm | 2 -- 16 files changed, 5 insertions(+), 33 deletions(-) diff --git a/code/datums/_ndatabase/code/brsql_adapter.dm b/code/datums/_ndatabase/code/brsql_adapter.dm index 345ddfe005f3..20b1768c5f79 100644 --- a/code/datums/_ndatabase/code/brsql_adapter.dm +++ b/code/datums/_ndatabase/code/brsql_adapter.dm @@ -101,8 +101,8 @@ SSdatabase.create_parametric_query(query_updatetable, qpars, CB) /datum/db/adapter/brsql_adapter/insert_table(table_name, list/values, datum/callback/CB, sync = FALSE) - if(!sync) - set waitfor = 0 + set waitfor = FALSE + var/length = values.len var/list/qpars = list() var/query_inserttable = getquery_insert_table(table_name, values, qpars) diff --git a/code/datums/_ndatabase/code/native_adapter.dm b/code/datums/_ndatabase/code/native_adapter.dm index a5e4d41fb6a0..1c23a6ceab8f 100644 --- a/code/datums/_ndatabase/code/native_adapter.dm +++ b/code/datums/_ndatabase/code/native_adapter.dm @@ -83,8 +83,7 @@ SSdatabase.create_query(query_gettable, CB) /datum/db/adapter/native_adapter/update_table(table_name, list/values, datum/callback/CB, sync = FALSE) - if(!sync) - set waitfor = 0 + set waitfor = FALSE for(var/list/vals in values) var/list/qpars = list() diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 3c4104b6c283..c9092a750f73 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -59,8 +59,6 @@ if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY) deconstruct(FALSE) return - else - return /obj/structure/machinery/optable/get_examine_text(mob/user) . = ..() diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index 16512a944be1..e6fc0c8de76e 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -431,8 +431,6 @@ var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function AAlarmwires |= wireFlag switch(wireIndex) - if(AALARM_WIRE_IDSCAN) - if(AALARM_WIRE_POWER) shorted = 0 shock(usr, 50) diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index b70829c708ed..d82591994e7b 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -551,7 +551,7 @@ var/speed = ((wires & WIRE_MOTOR1) ? 1:0) + ((wires & WIRE_MOTOR2) ? 2:0) switch(speed) if(0) - // do nothing + pass() if(1) process_bot() spawn(2) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index adce72f7d8b6..304b24a14f04 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -53,8 +53,6 @@ if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY) deconstruct(FALSE) return - else - return /obj/structure/machinery/computer/bullet_act(obj/projectile/Proj) if(exproof) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index b68ca41d6f09..fe85599018ae 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -123,7 +123,6 @@ else dat += "
[bdat]" - else else dat += text("{Log In}", src) show_browser(user, dat, "Medical Records", "med_rec") @@ -365,8 +364,6 @@ for(var/datum/data/record/E in GLOB.data_core.medical) if ((E.fields["ref"] == R.fields["ref"] || E.fields["id"] == R.fields["id"])) M = E - else - //Foreach continue //goto(2540) src.active1 = R src.active2 = M src.screen = 4 @@ -417,16 +414,12 @@ for(var/datum/data/record/R as anything in GLOB.data_core.medical) if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]))) src.active2 = R - else - //Foreach continue //goto(3229) if (!active2) temp = "Could not locate record [t1]." else for(var/datum/data/record/E in GLOB.data_core.general) if ((E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"])) src.active1 = E - else - //Foreach continue //goto(3334) src.screen = 4 if (href_list["print_p"]) diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 3858230a089c..f6adaa8edd4e 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -20,7 +20,6 @@ for(var/obj/structure/machinery/mass_driver/M in machines) if(M.id == id) connected = M - else return return diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index e6df92d258c0..99996bea8978 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -54,7 +54,6 @@ src.health -= W.force * 0.75 if("brute") src.health -= W.force * 0.5 - else if (src.health <= 0) src.explode() ..() diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index bebe0ec8b27f..56c6ae45cda7 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -95,8 +95,6 @@ if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY) deconstruct(FALSE) return - else - return /obj/effect/glowshroom/fire_act(exposed_temperature, exposed_volume) if(exposed_temperature > 300) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 077c0a463aaa..94de69343c1e 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -268,7 +268,6 @@ cases. Override_icon_state should be a list.*/ size = "huge" if(SIZE_MASSIVE) size = "massive" - else . += "This is a [blood_color ? blood_color != "#030303" ? "bloody " : "oil-stained " : ""][icon2html(src, user)][src.name]. It is a [size] item." if(desc) . += desc diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index 06a4d785e677..179e2014f8cf 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -182,8 +182,7 @@ return 0 var/inaccurate = 0 - if(W.sharp == IS_SHARP_ITEM_ACCURATE) - else if(W.sharp == IS_SHARP_ITEM_BIG) + if(W.sharp == IS_SHARP_ITEM_BIG) inaccurate = 1 else return 1 diff --git a/code/game/objects/structures/bookcase.dm b/code/game/objects/structures/bookcase.dm index c71b2853ea07..becb0906e3c6 100644 --- a/code/game/objects/structures/bookcase.dm +++ b/code/game/objects/structures/bookcase.dm @@ -58,8 +58,6 @@ contents_explosion(severity) deconstruct(FALSE) return - else - return /obj/structure/bookcase/update_icon() if(contents.len < 5) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 7c9faaf1a027..9f0417ccb372 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -130,8 +130,6 @@ contents_explosion(severity) deconstruct(FALSE) return - else - return /obj/structure/closet/crate/alpha name = "alpha squad crate" diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 38201e052c50..d2b3d36b5920 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -43,8 +43,6 @@ if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY) deconstruct(FALSE) return - else - return /obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob) diff --git a/code/game/objects/structures/reagent_dispensers.dm b/code/game/objects/structures/reagent_dispensers.dm index 7dc6d883a2d5..6471dfa21520 100644 --- a/code/game/objects/structures/reagent_dispensers.dm +++ b/code/game/objects/structures/reagent_dispensers.dm @@ -119,8 +119,6 @@ if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY) deconstruct(FALSE) return - else - return /obj/structure/reagent_dispensers/attack_hand() if(!reagents || reagents.locked) From 4365bd34247beaea8a692d93e8d155be018c1f45 Mon Sep 17 00:00:00 2001 From: harryob Date: Thu, 12 Oct 2023 22:13:56 +0100 Subject: [PATCH 14/26] gitignore update --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 210efc84d75b..4d2b7e810de8 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ test_environment.txt # byond-tracy backend, not shipped with the codebase so it shouldn't be maintained prof.dll libprof.so + +# OpenDream compatibility stuff +colonialmarines.json From c3ae41625d9f20e6c758ef2efca435e346fe5e06 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Fri, 13 Oct 2023 12:35:53 +0100 Subject: [PATCH 15/26] lets get moving --- code/__odlint.dm | 2 +- tools/ci/lints.dm => code/__pragmas.dm | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tools/ci/lints.dm => code/__pragmas.dm (100%) diff --git a/code/__odlint.dm b/code/__odlint.dm index 6474ad77420e..f42517133746 100644 --- a/code/__odlint.dm +++ b/code/__odlint.dm @@ -6,6 +6,6 @@ #ifdef OPENDREAM // These are in their own file as you need to do it with an include as a hack to avoid // SpacemanDMM evaluating the #pragma lines, even if its outside a block it cares about -#include "../tools/ci/lints.dm" +#include "__pragmas.dm" #endif #endif diff --git a/tools/ci/lints.dm b/code/__pragmas.dm similarity index 100% rename from tools/ci/lints.dm rename to code/__pragmas.dm From 48839b93dd7a5cdb95a3d5b49363f9480fdca831 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Fri, 13 Oct 2023 12:45:58 +0100 Subject: [PATCH 16/26] whoops --- tools/ci/validate_dme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci/validate_dme.py b/tools/ci/validate_dme.py index 03136949ae0c..55666480425d 100644 --- a/tools/ci/validate_dme.py +++ b/tools/ci/validate_dme.py @@ -19,7 +19,7 @@ r'code/__HELPERS/BSQL/**/*.dm', # Included as part of OD lints - r'tools/ci/lints.dm' + r'code/__pragmas.dm' ] lines = [] From 4cec25b8b0e09f067175b98cf1442bdaa8324fe3 Mon Sep 17 00:00:00 2001 From: harryob Date: Fri, 13 Oct 2023 19:41:52 +0100 Subject: [PATCH 17/26] and it goes like this --- code/__DEFINES/bullet_traits.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/bullet_traits.dm b/code/__DEFINES/bullet_traits.dm index 40e250cd0dd2..f629bce151c2 100644 --- a/code/__DEFINES/bullet_traits.dm +++ b/code/__DEFINES/bullet_traits.dm @@ -3,7 +3,7 @@ // list of args if there are any args /// An entry to a list for giving projectiles bullet traits /// Must be placed inside of a list -#define BULLET_TRAIT_ENTRY(trait, args...) trait = list(##args) +#define BULLET_TRAIT_ENTRY(trait, args...) length(list(##args)) ? trait = list(##args) : trait /// An entry to a list for giving projectiles bullet traits with a unique ID /// Must be placed inside of a list #define BULLET_TRAIT_ENTRY_ID(id, trait, args...) id = list(trait, ##args) From 866ad5fd3b62779354ff5a551fd3e3695c502791 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 15 Oct 2023 21:04:42 +0100 Subject: [PATCH 18/26] lets not --- code/__DEFINES/bullet_traits.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/bullet_traits.dm b/code/__DEFINES/bullet_traits.dm index f629bce151c2..40e250cd0dd2 100644 --- a/code/__DEFINES/bullet_traits.dm +++ b/code/__DEFINES/bullet_traits.dm @@ -3,7 +3,7 @@ // list of args if there are any args /// An entry to a list for giving projectiles bullet traits /// Must be placed inside of a list -#define BULLET_TRAIT_ENTRY(trait, args...) length(list(##args)) ? trait = list(##args) : trait +#define BULLET_TRAIT_ENTRY(trait, args...) trait = list(##args) /// An entry to a list for giving projectiles bullet traits with a unique ID /// Must be placed inside of a list #define BULLET_TRAIT_ENTRY_ID(id, trait, args...) id = list(trait, ##args) From ac3cacd29bfb28b5c5b791d08b4cbbf504195908 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 19 Oct 2023 07:19:08 +0100 Subject: [PATCH 19/26] caching 2 --- .github/workflows/ci_suite.yml | 7 ++++++- tools/ci/download_od.sh | 11 +++++++++++ tools/ci/setup_od.sh | 8 +------- 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 tools/ci/download_od.sh diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index 59f4be260e94..a4d227a396b2 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -67,12 +67,17 @@ jobs: steps: - name: Restore OpenDream cache uses: actions/cache@v3 + id: cache-od with: - path: OpenDream + path: ~/OpenDream key: ${{ runner.os }}-opendream-${{ hashFiles('dependencies.sh') }} restore-keys: | ${{ runner.os }}-opendream- - uses: actions/checkout@v3 + - name: Download OD + if: steps.cache-od.outputs.cache-hit != 'true' + run: | + bash tools/ci/download_od.sh - name: Setup OD run: | bash tools/ci/setup_od.sh diff --git a/tools/ci/download_od.sh b/tools/ci/download_od.sh new file mode 100644 index 000000000000..024f93f9289c --- /dev/null +++ b/tools/ci/download_od.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -eo pipefail + +if [ -z "${OPENDREAM_VERSION+x}" ]; then + source dependencies.sh +fi + +git clone https://github.com/OpenDreamProject/OpenDream.git ~/OpenDream +cd ~/OpenDream +git checkout tags/v${OPENDREAM_VERSION} +git submodule update --init --recursive diff --git a/tools/ci/setup_od.sh b/tools/ci/setup_od.sh index d548b3d72fdf..6d2ec170687c 100644 --- a/tools/ci/setup_od.sh +++ b/tools/ci/setup_od.sh @@ -1,13 +1,7 @@ #!/bin/bash set -eo pipefail -if [ -z "${OPENDREAM_VERSION+x}" ]; then - source dependencies.sh -fi +cd ~/OpenDream -git clone https://github.com/OpenDreamProject/OpenDream.git OpenDream -cd OpenDream -git checkout tags/v${OPENDREAM_VERSION} -git submodule update --init --recursive dotnet restore dotnet build -c Release From 838803081f31f95744e71f1bc213ccd6bf120ea6 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 19 Oct 2023 07:22:17 +0100 Subject: [PATCH 20/26] whoops --- tools/ci/run_od.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ci/run_od.sh b/tools/ci/run_od.sh index fa7438568fb1..3eeac5907353 100644 --- a/tools/ci/run_od.sh +++ b/tools/ci/run_od.sh @@ -1,3 +1,4 @@ #!/bin/bash set -eo pipefail -dotnet OpenDream/DMCompiler/bin/Release/net7.0/DMCompiler.dll --suppress-unimplemented colonialmarines.dme + +dotnet ~/OpenDream/DMCompiler/bin/Release/net7.0/DMCompiler.dll --suppress-unimplemented colonialmarines.dme From 6f5ccc061f8530456d86882c22ae2db2425d8e83 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 19 Oct 2023 07:32:27 +0100 Subject: [PATCH 21/26] double checking --- .github/workflows/ci_suite.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index a4d227a396b2..ff74cf7739d2 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -79,6 +79,7 @@ jobs: run: | bash tools/ci/download_od.sh - name: Setup OD + if: steps.cache-od.outputs.cache-hit != 'true' run: | bash tools/ci/setup_od.sh - name: Run OD From 58d83570f97c4b15ee39c1a740cf88865a50e3bb Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 19 Oct 2023 07:43:15 +0100 Subject: [PATCH 22/26] trying this --- .github/workflows/ci_suite.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index ff74cf7739d2..e75cef853fb8 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -65,14 +65,16 @@ jobs: name: Lint with OpenDream runs-on: ubuntu-20.04 steps: + - name: Get OpenDream Version + run: | + source dependencies.sh + echo "$OPENDREAM_VERSION" >> $GITHUB_ENV - name: Restore OpenDream cache uses: actions/cache@v3 id: cache-od with: path: ~/OpenDream - key: ${{ runner.os }}-opendream-${{ hashFiles('dependencies.sh') }} - restore-keys: | - ${{ runner.os }}-opendream- + key: ${{ runner.os }}-opendream-${{ env.OPENDREAM_VERSION }} - uses: actions/checkout@v3 - name: Download OD if: steps.cache-od.outputs.cache-hit != 'true' From 25cd2d5410f1197ac7d736eb678bfedd52709fed Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 19 Oct 2023 07:44:34 +0100 Subject: [PATCH 23/26] order is important --- .github/workflows/ci_suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index e75cef853fb8..601452b199f9 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -65,6 +65,7 @@ jobs: name: Lint with OpenDream runs-on: ubuntu-20.04 steps: + - uses: actions/checkout@v3 - name: Get OpenDream Version run: | source dependencies.sh @@ -75,7 +76,6 @@ jobs: with: path: ~/OpenDream key: ${{ runner.os }}-opendream-${{ env.OPENDREAM_VERSION }} - - uses: actions/checkout@v3 - name: Download OD if: steps.cache-od.outputs.cache-hit != 'true' run: | From ae558786325b9925cbb1d3c834d73c226e3bd810 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 19 Oct 2023 07:46:30 +0100 Subject: [PATCH 24/26] sets the env var properly --- .github/workflows/ci_suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index 601452b199f9..0518432ad435 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -69,7 +69,7 @@ jobs: - name: Get OpenDream Version run: | source dependencies.sh - echo "$OPENDREAM_VERSION" >> $GITHUB_ENV + echo "OPENDREAM_VERSION=$OPENDREAM_VERSION" >> $GITHUB_ENV - name: Restore OpenDream cache uses: actions/cache@v3 id: cache-od From 66c732e37e8b23db4157ab34ffd806a47c60735d Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 19 Oct 2023 07:56:01 +0100 Subject: [PATCH 25/26] spag change --- .github/workflows/ci_suite.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_suite.yml b/.github/workflows/ci_suite.yml index 0518432ad435..0488055312f7 100644 --- a/.github/workflows/ci_suite.yml +++ b/.github/workflows/ci_suite.yml @@ -76,15 +76,15 @@ jobs: with: path: ~/OpenDream key: ${{ runner.os }}-opendream-${{ env.OPENDREAM_VERSION }} - - name: Download OD + - name: Download OpenDream if: steps.cache-od.outputs.cache-hit != 'true' run: | bash tools/ci/download_od.sh - - name: Setup OD + - name: Setup OpenDream if: steps.cache-od.outputs.cache-hit != 'true' run: | bash tools/ci/setup_od.sh - - name: Run OD + - name: Run OpenDream run: | bash tools/ci/run_od.sh From 8484c44b2f2033d07dd4b0676ee4520e230f5553 Mon Sep 17 00:00:00 2001 From: harryob Date: Thu, 19 Oct 2023 10:22:19 +0100 Subject: [PATCH 26/26] Update utility_closets.dm --- .../objects/structures/crates_lockers/closets/utility_closets.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm index 887a36115b8d..b000fd5733a2 100644 --- a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm @@ -50,6 +50,7 @@ new /obj/item/tank/emergency_oxygen/engi(src) new /obj/item/clothing/mask/gas(src) new /obj/item/clothing/mask/gas(src) + new /obj/item/storage/firstaid/o2(src) // teehee - Ah, tg coders... if ("delete")