Skip to content

Commit

Permalink
Merge branch 'master' into sg1023-stats-standards
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 3, 2023
2 parents 7dc51eb + f8a133b commit ac81df4
Show file tree
Hide file tree
Showing 235 changed files with 2,360 additions and 1,430 deletions.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ body:
placeholder: "#1, #2, #3, etc"
validations:
required: true
- type: input
id: round-id
attributes:
label: Round ID
description: If known, what was the Round ID this bug was found on? Can be left blank if unknown or occured across multiple rounds.
placeholder: "12345"
- type: textarea
id: what-happened
attributes:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,34 @@ jobs:
with:
outputFile: output-annotations.txt


odlint:
name: Lint with OpenDream
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Get OpenDream Version
run: |
source dependencies.sh
echo "OPENDREAM_VERSION=$OPENDREAM_VERSION" >> $GITHUB_ENV
- name: Restore OpenDream cache
uses: actions/cache@v3
id: cache-od
with:
path: ~/OpenDream
key: ${{ runner.os }}-opendream-${{ env.OPENDREAM_VERSION }}
- name: Download OpenDream
if: steps.cache-od.outputs.cache-hit != 'true'
run: |
bash tools/ci/download_od.sh
- name: Setup OpenDream
if: steps.cache-od.outputs.cache-hit != 'true'
run: |
bash tools/ci/setup_od.sh
- name: Run OpenDream
run: |
bash tools/ci/run_od.sh
compile_all_maps:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Compile Maps
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 12 additions & 1 deletion code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ block( \
/// Only use the CEILING_PROTECTION_TIER_X defines for `protection_level`
#define CEILING_IS_PROTECTED(ceiling, protection_level) (ceiling >= protection_level)


// Default font settings
#define FONT_SIZE "5pt"
#define DEFAULT_FONT_COLOR "#09f"
Expand Down Expand Up @@ -493,6 +492,18 @@ block( \
#define TURF_PROTECTION_CAS 2
#define TURF_PROTECTION_OB 3

/// Convert a turf protection level to a ceiling protection level
/proc/get_ceiling_protection_level(turf_protection_level)
switch(turf_protection_level)
if(TURF_PROTECTION_OB)
return CEILING_PROTECTION_TIER_4
if(TURF_PROTECTION_CAS)
return CEILING_PROTECTION_TIER_3
if(TURF_PROTECTION_MORTAR)
return CEILING_PROTECTION_TIER_2
else
return CEILING_NO_PROTECTION

// Anything above the deck boundary is the upper deck, anything below is the lower deck
// This is exclusive, so anything ON the boundary is an edge case that's neither on the upper nor the lower deck
#define ALMAYER_DECK_BOUNDARY 101
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/bullet_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@

///When the transform or an atom is varedited through vv topic.
#define COMSIG_ATOM_VV_MODIFY_TRANSFORM "atom_vv_modify_transform"

/// Called when an atom has something mouse dropped on it, from /client/MouseDrop: (atom/dropped_on)
#define COMSIG_ATOM_DROPPED_ON "atom_dropped_on"

/// Called when an atom is mouse dropped on another atom, from /client/MouseDrop: (atom/dropped_onto)
#define COMSIG_ATOM_DROP_ON "atom_drop_on"
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,4 @@ var/list/default_xeno_onmob_icons = list(
#define HANDLING_LIMBS list("l_arm","l_hand", "r_arm", "r_hand")
#define EXTREMITY_LIMBS list("l_leg","l_foot","r_leg","r_foot","l_arm","l_hand","r_arm","r_hand")
#define CORE_LIMBS list("chest","head","groin")

10 changes: 6 additions & 4 deletions code/__DEFINES/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@
#define MOBILE_SHUTTLE_ID_ERT_BIG "ert_boarding_shuttle"

#define MOBILE_TRIJENT_ELEVATOR "trijentshuttle2"
#define STAT_TRIJENT_LZ1 "trigent_lz1"
#define STAT_TRIJENT_LZ2 "trigent_lz2"
#define STAT_TRIJENT_ENGI "trigent_engineering"
#define STAT_TRIJENT_OMEGA "trigent_omega"
#define STAT_TRIJENT_EMPTY "trijent_empty"
#define STAT_TRIJENT_OCCUPIED "trijent_occupied"
#define STAT_TRIJENT_LZ1 "trijent_lz1"
#define STAT_TRIJENT_LZ2 "trijent_lz2"
#define STAT_TRIJENT_ENGI "trijent_engineering"
#define STAT_TRIJENT_OMEGA "trijent_omega"

#define MOBILE_SHUTTLE_LIFEBOAT_PORT "lifeboat-port"
#define MOBILE_SHUTTLE_LIFEBOAT_STARBOARD "lifeboat-starboard"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ See also /datum/surgery_step/saw_off_limb/failure var/list/cannot_hack, listing
#define SURGERY_TOOLS_SEVER_BONE list(\
/obj/item/tool/surgery/circular_saw = SURGERY_TOOL_MULT_IDEAL,\
/obj/item/weapon/twohanded/fireaxe = SURGERY_TOOL_MULT_SUBOPTIMAL,\
/obj/item/weapon/claymore/mercsword/machete = SURGERY_TOOL_MULT_SUBOPTIMAL,\
/obj/item/weapon/sword/machete = SURGERY_TOOL_MULT_SUBOPTIMAL,\
/obj/item/tool/hatchet = SURGERY_TOOL_MULT_SUBSTITUTE,\
/obj/item/tool/kitchen/knife/butcher = SURGERY_TOOL_MULT_SUBSTITUTE,\
/obj/item/attachable/bayonet = SURGERY_TOOL_MULT_BAD_SUBSTITUTE\
Expand Down
13 changes: 12 additions & 1 deletion code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tgstation-server DMAPI

#define TGS_DMAPI_VERSION "6.5.3"
#define TGS_DMAPI_VERSION "6.6.1"

// All functions and datums outside this document are subject to change with any version and should not be relied on.

Expand Down Expand Up @@ -129,6 +129,13 @@
/// DreamDaemon Ultrasafe security level.
#define TGS_SECURITY_ULTRASAFE 2

/// DreamDaemon public visibility level.
#define TGS_VISIBILITY_PUBLIC 0
/// DreamDaemon private visibility level.
#define TGS_VISIBILITY_PRIVATE 1
/// DreamDaemon invisible visibility level.
#define TGS_VISIBILITY_INVISIBLE 2

//REQUIRED HOOKS

/**
Expand Down Expand Up @@ -458,6 +465,10 @@
/world/proc/TgsSecurityLevel()
return

/// Returns the current BYOND visibility level as a TGS_VISIBILITY_ define if TGS is present, null otherwise. Requires TGS to be using interop API version 5 or higher otherwise the string "___unimplemented" wil be returned. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVisibility()
return

/// Returns a list of active [/datum/tgs_revision_information/test_merge]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsTestMerges()
return
Expand Down
5 changes: 3 additions & 2 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,12 @@ world
if (isnull(dir))
dir = thing.dir

if (ishuman(thing)) // Shitty workaround for a BYOND issue.
// Commented out because this is seemingly our source of bad icon operations
/* if (ishuman(thing)) // Shitty workaround for a BYOND issue.
var/icon/temp = icon2collapse
icon2collapse = icon()
icon2collapse.Insert(temp, dir = SOUTH)
dir = SOUTH
dir = SOUTH*/
else
if (isnull(dir))
dir = SOUTH
Expand Down
5 changes: 1 addition & 4 deletions code/__HELPERS/type2type.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -77,7 +77,6 @@
hex += "E"
if(15.0)
hex += "F"
else
power--
while(length(hex) < placeholder)
hex = text("0[]", hex)
Expand Down Expand Up @@ -165,8 +164,6 @@
return 6
if("SOUTHWEST")
return 10
else
return

//Converts an angle (degrees) into an ss13 direction
/proc/angle2dir(degree)
Expand Down
11 changes: 11 additions & 0 deletions code/__odlint.dm
Original file line number Diff line number Diff line change
@@ -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 "__pragmas.dm"
#endif
#endif
27 changes: 27 additions & 0 deletions code/__pragmas.dm
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion code/_byond_version_compat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/_compile_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions code/_onclick/click_hold.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,12 @@

// Add the hovered atom to the trace
LAZYADD(mouse_trace_history, over_obj)

/client/MouseDrop(datum/over_object, datum/src_location, over_location, src_control, over_control, params)
. = ..()

if(src_location)
SEND_SIGNAL(src_location, COMSIG_ATOM_DROPPED_ON, over_object, src)

if(over_object)
SEND_SIGNAL(over_object, COMSIG_ATOM_DROP_ON, src_location, src)
20 changes: 20 additions & 0 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
/atom/movable/screen/inventory
var/slot_id //The indentifier for the slot. It has nothing to do with ID cards.

/atom/movable/screen/inventory/Initialize(mapload, ...)
. = ..()

RegisterSignal(src, COMSIG_ATOM_DROPPED_ON, PROC_REF(handle_dropped_on))

/atom/movable/screen/close
name = "close"
Expand Down Expand Up @@ -325,6 +329,22 @@
return 1
return 0

/atom/movable/screen/inventory/proc/handle_dropped_on(atom/dropped_on, atom/dropping, client/user)
SIGNAL_HANDLER

if(slot_id != WEAR_L_HAND && slot_id != WEAR_R_HAND)
return

if(!isstorage(dropping.loc))
return

if(!user.mob.Adjacent(dropping))
return

var/obj/item/storage/store = dropping.loc
store.remove_from_storage(dropping, get_turf(user.mob))
user.mob.put_in_active_hand(dropping)

/atom/movable/screen/throw_catch
name = "throw/catch"
icon = 'icons/mob/hud/human_midnight.dmi'
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 13 additions & 9 deletions code/controllers/subsystem/init/law.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ SUBSYSTEM_DEF(law_init)
var/list/minor_law = list()
var/list/major_law = list()
var/list/capital_law = list()
var/list/precautionary_law = list()

/datum/controller/subsystem/law_init/Initialize()
for(var/L in subtypesof(/datum/law/optional_law))
optional_law += new L
for(var/law in subtypesof(/datum/law/optional_law))
optional_law += new law

for(var/L in subtypesof(/datum/law/minor_law))
minor_law += new L
for(var/law in subtypesof(/datum/law/minor_law))
minor_law += new law

for(var/L in subtypesof(/datum/law/major_law))
major_law += new L
for(var/law in subtypesof(/datum/law/major_law))
major_law += new law

for(var/L in subtypesof(/datum/law/capital_law))
capital_law += new L
for(var/law in subtypesof(/datum/law/capital_law))
capital_law += new law

laws = optional_law + minor_law + major_law + capital_law
for(var/law in subtypesof(/datum/law/precautionary_charge))
precautionary_law += new law

laws = optional_law + minor_law + major_law + capital_law + precautionary_law

return SS_INIT_SUCCESS
6 changes: 3 additions & 3 deletions code/controllers/subsystem/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SUBSYSTEM_DEF(mapping)
var/list/map_templates = list()

var/list/shuttle_templates = list()
var/list/all_shuttle_templates = list()

var/list/areas_in_z = list()

Expand All @@ -29,9 +30,7 @@ SUBSYSTEM_DEF(mapping)
/datum/controller/subsystem/mapping/proc/HACK_LoadMapConfig()
if(!configs)
configs = load_map_configs(ALL_MAPTYPES, error_if_missing = FALSE)
for(var/i in GLOB.clients)
var/client/C = i
winset(C, null, "mainwindow.title='[CONFIG_GET(string/title)] - [SSmapping.configs[SHIP_MAP].map_name]'")
world.name = "[CONFIG_GET(string/title)] - [SSmapping.configs[SHIP_MAP].map_name]"

/datum/controller/subsystem/mapping/Initialize(timeofday)
HACK_LoadMapConfig()
Expand Down Expand Up @@ -240,6 +239,7 @@ SUBSYSTEM_DEF(mapping)
var/datum/map_template/shuttle/S = new shuttle_type()

shuttle_templates[S.shuttle_id] = S
all_shuttle_templates[item] = S
map_templates[S.shuttle_id] = S

/datum/controller/subsystem/mapping/proc/RequestBlockReservation(width, height, z, type = /datum/turf_reservation, turf_type_override)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit ac81df4

Please sign in to comment.