Skip to content

Commit

Permalink
Merge remote-tracking branch 'CMSS13/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Oct 26, 2023
2 parents 468fb17 + c590d11 commit 5aadb5b
Show file tree
Hide file tree
Showing 108 changed files with 1,336 additions and 1,149 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 @@ -63,6 +63,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
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.0"

// 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
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
4 changes: 1 addition & 3 deletions code/controllers/subsystem/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,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
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
4 changes: 2 additions & 2 deletions code/datums/_ndatabase/code/brsql_adapter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions code/datums/_ndatabase/code/native_adapter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 9 additions & 0 deletions code/datums/ammo/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@
else
living_mob.apply_stamina_damage(fired_projectile.ammo.damage, fired_projectile.def_zone, ARMOR_BULLET)

/datum/ammo/proc/slowdown(mob/living/living_mob, obj/projectile/fired_projectile)
if(iscarbonsizexeno(living_mob))
var/mob/living/carbon/xenomorph/target = living_mob
target.apply_effect(1, SUPERSLOW)
target.apply_effect(2, SLOW)
to_chat(target, SPAN_XENODANGER("You are slowed by the sudden impact!"))
else
living_mob.apply_stamina_damage(fired_projectile.ammo.damage, fired_projectile.def_zone, ARMOR_BULLET)

/datum/ammo/proc/pushback(mob/target_mob, obj/projectile/fired_projectile, max_range = 2)
if(!target_mob || target_mob == fired_projectile.firer || fired_projectile.distance_travelled > max_range || target_mob.lying)
return
Expand Down
5 changes: 3 additions & 2 deletions code/datums/ammo/bullet/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
penetration = ARMOR_PENETRATION_TIER_4
accuracy = HIT_ACCURACY_TIER_3

/datum/ammo/bullet/revolver/heavy/on_hit_mob(mob/M, obj/projectile/P)
knockback(M, P, 4)
/datum/ammo/bullet/revolver/heavy/on_hit_mob(mob/entity, obj/projectile/bullet)
slowdown(entity, bullet)
pushback(entity, bullet, 4)

/datum/ammo/bullet/revolver/incendiary
name = "incendiary revolver bullet"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/emergency_calls/emergency_call.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
return
var/deathtime = world.time - usr.timeofdeath

if(deathtime < 1 MINUTES) //Nice try, ghosting right after the announcement
if(deathtime < 30 SECONDS) //Nice try, ghosting right after the announcement
if(SSmapping.configs[GROUND_MAP].map_name != MAP_WHISKEY_OUTPOST) // people ghost so often on whiskey outpost.
to_chat(src, SPAN_WARNING("You ghosted too recently."))
return
Expand Down
4 changes: 2 additions & 2 deletions code/datums/keybinding/client.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


/datum/keybinding/client/admin_help
hotkey_keys = list("F1")
classic_keys = list("F1")
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
name = "admin_help"
full_name = "Admin Help"
description = "Ask an admin for help."
Expand Down
13 changes: 10 additions & 3 deletions code/datums/langchat/langchat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
M.client.images -= langchat_image
langchat_listeners = null

/atom/proc/langchat_set_x_offset()
langchat_image.maptext_x = world.icon_size / 2 - langchat_image.maptext_width / 2
/atom/movable/langchat_set_x_offset()
langchat_image.maptext_x = bound_width / 2 - langchat_image.maptext_width / 2
/mob/langchat_set_x_offset()
langchat_image.maptext_x = icon_size / 2 - langchat_image.maptext_width / 2

///Creates the image if one does not exist, resets settings that are modified by speech procs.
/atom/proc/langchat_make_image(override_color = null)
if(!langchat_image)
Expand All @@ -56,8 +63,8 @@
langchat_image.appearance_flags = NO_CLIENT_COLOR|KEEP_APART|RESET_COLOR|RESET_TRANSFORM
langchat_image.maptext_y = langchat_height
langchat_image.maptext_height = 64
langchat_image.maptext_x = - world.icon_size - get_pixel_position_x(src, TRUE)
langchat_image.maptext_y -= LANGCHAT_MESSAGE_POP_Y_SINK
langchat_set_x_offset()

langchat_image.pixel_y = 0
langchat_image.alpha = 0
Expand Down Expand Up @@ -102,7 +109,7 @@

langchat_image.maptext = text_to_display
langchat_image.maptext_width = LANGCHAT_WIDTH
langchat_image.maptext_x = - world.icon_size - get_pixel_position_x(src, TRUE)
langchat_set_x_offset()

langchat_listeners = listeners
for(var/mob/M in langchat_listeners)
Expand Down Expand Up @@ -149,7 +156,7 @@

langchat_image.maptext = text_to_display
langchat_image.maptext_width = LANGCHAT_WIDTH * 2
langchat_image.maptext_x = - world.icon_size - get_pixel_position_x(src, TRUE) - LANGCHAT_WIDTH / 2
langchat_set_x_offset()

langchat_listeners = listeners
for(var/mob/M in langchat_listeners)
Expand Down
Loading

0 comments on commit 5aadb5b

Please sign in to comment.