Skip to content

Commit

Permalink
MISSED MIRROR [Lints Against Unmanaged Local Defines] (#20204)
Browse files Browse the repository at this point in the history
* tgstation/tgstation#74333

https: //github.com/tgstation/tgstation/pull/74333
Co-Authored-By: tattle <[email protected]>

* var stuff

Co-Authored-By: tattle <[email protected]>

* vars

* Update sol_fed.dm

---------

Co-authored-by: tattle <[email protected]>
  • Loading branch information
Gandalf2k15 and dragomagol authored Apr 1, 2023
1 parent 16e9175 commit e4b4d4d
Show file tree
Hide file tree
Showing 248 changed files with 1,068 additions and 316 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
tools/bootstrap/python tools/validate_dme.py <tgstation.dme
tools/bootstrap/python -m tools.maplint.source --github
tools/build/build --ci lint tgui-test
tools/bootstrap/python -m define_sanity.check
tools/bootstrap/python -m dmi.test
tools/bootstrap/python -m mapmerge2.dmm_test
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,6 @@ Tracy.exe

# named byond versions config
/tools/build/dm_versions.json

# From /tools/define_sanity/check.py - potential output file that we load onto the user's machine that we don't want to have committed.
define_sanity_output.txt
12 changes: 12 additions & 0 deletions code/__DEFINES/_atoms.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#define BAD_INIT_QDEL_BEFORE 1
#define BAD_INIT_DIDNT_INIT 2
#define BAD_INIT_SLEPT 4
#define BAD_INIT_NO_HINT 8

#ifdef PROFILE_MAPLOAD_INIT_ATOM
#define PROFILE_INIT_ATOM_BEGIN(...) var/__profile_stat_time = TICK_USAGE
#define PROFILE_INIT_ATOM_END(atom) mapload_init_times[##atom.type] += TICK_USAGE_TO_MS(__profile_stat_time)
#else
#define PROFILE_INIT_ATOM_BEGIN(...)
#define PROFILE_INIT_ATOM_END(...)
#endif
7 changes: 7 additions & 0 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,10 @@ GLOBAL_VAR_INIT(ghost_role_flags, (~0))

/// A value for /datum/admins/cached_feedback_link to indicate empty, rather than unobtained
#define NO_FEEDBACK_LINK "no_feedback_link"

/// State when an interview has been approved
#define INTERVIEW_APPROVED "interview_approved"
/// State when an interview as been denied
#define INTERVIEW_DENIED "interview_denied"
/// State when an interview has had no action on it yet
#define INTERVIEW_PENDING "interview_pending"
6 changes: 6 additions & 0 deletions code/__DEFINES/airlock.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Airlock light states, used for generating the light overlays
#define AIRLOCK_LIGHT_BOLTS "bolts"
#define AIRLOCK_LIGHT_EMERGENCY "emergency"
#define AIRLOCK_LIGHT_DENIED "denied"
#define AIRLOCK_LIGHT_CLOSING "closing"
#define AIRLOCK_LIGHT_OPENING "opening"
5 changes: 5 additions & 0 deletions code/__DEFINES/area_editor.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Used to edit areas.
#define AREA_ERRNONE 0
#define AREA_STATION 1
#define AREA_SPACE 2
#define AREA_SPECIAL 3
13 changes: 13 additions & 0 deletions code/__DEFINES/atmospherics/atmos_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,16 @@

/// TLV datums will ignore variables set to this.
#define TLV_VALUE_IGNORE -1

#define CIRCULATOR_HOT 0
#define CIRCULATOR_COLD 1

///Default pressure, used in the UI to reset the settings
#define PUMP_DEFAULT_PRESSURE (ONE_ATMOSPHERE)
///Maximum settable pressure
#define PUMP_MAX_PRESSURE (PUMP_DEFAULT_PRESSURE * 25)
///Minimum settable pressure
#define PUMP_MIN_PRESSURE (PUMP_DEFAULT_PRESSURE / 10)
///What direction is the machine pumping (into pump/port or out to the tank/area)?
#define PUMP_IN TRUE
#define PUMP_OUT FALSE
2 changes: 2 additions & 0 deletions code/__DEFINES/atmospherics/atmos_mob_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
/// Amount of air to take a from a tile
#define BREATH_PERCENTAGE (BREATH_VOLUME/CELL_VOLUME)

#define QUANTIZE(variable) (round((variable), (MOLAR_ACCURACY)))

/// Return this from a while_present proc to call its on_loss version, if one exists
/// Useful for doing "we're done" effects without duped code
#define BREATH_LOST 1
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/basketball.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// You hit exhaustion when you use 100 stamina
#define STAMINA_COST_SHOOTING 10 //! shooting with RMB drains stamina (but LMB does not)
#define STAMINA_COST_DUNKING 20 //! dunking is more strenous than shooting
#define STAMINA_COST_DUNKING_MOB 30 //! dunking another person is harder
#define STAMINA_COST_SPINNING 15 //! spin emote uses stamina while holding ball
#define STAMINA_COST_DISARMING 10 //! getting shoved or disarmed while holding ball drains stamina
5 changes: 5 additions & 0 deletions code/__DEFINES/cameranets.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// We only want chunk sizes that are to the power of 2. E.g: 2, 4, 8, 16, etc..
#define CHUNK_SIZE 16
/// Takes a position, transforms it into a chunk bounded position. Indexes at 1 so it'll land on actual turfs always
#define GET_CHUNK_COORD(v) (max((FLOOR(v, CHUNK_SIZE)), 1))

4 changes: 4 additions & 0 deletions code/__DEFINES/changeling.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// The duration of the fakedeath coma.
#define LING_FAKEDEATH_TIME (40 SECONDS)
/// The number of recent spoken lines to gain on absorbing a mob
#define LING_ABSORB_RECENT_SPEECH 8
3 changes: 3 additions & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#define MESSAGE_TYPE_ATTACKLOG "attacklog"
#define MESSAGE_TYPE_DEBUG "debug"

/// Max length of chat message in characters
#define CHAT_MESSAGE_MAX_LENGTH 110

//debug printing macros (for development and testing)
/// Used for debug messages to the world
#define debug_world(msg) if (GLOB.Debug2) to_chat(world, \
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@

/// Force the config directory to be something other than "config"
#define OVERRIDE_CONFIG_DIRECTORY_PARAMETER "config-directory"

// Config entry types
#define VALUE_MODE_NUM 0
#define VALUE_MODE_TEXT 1
#define VALUE_MODE_FLAG 2

#define KEY_MODE_TEXT 0
#define KEY_MODE_TYPE 1
7 changes: 7 additions & 0 deletions code/__DEFINES/construction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,10 @@ GLOBAL_LIST_INIT(crafting_category, list(

/// How much less resources the RCD uses when reconstructing
#define RCD_MEMORY_COST_BUFF 8

// Defines for the construction component
#define FORWARD 1
#define BACKWARD -1

#define ITEM_DELETE "delete"
#define ITEM_MOVE_INSIDE "move_inside"
8 changes: 8 additions & 0 deletions code/__DEFINES/crafting.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
///If the machine is used/deleted in the crafting process
#define CRAFTING_MACHINERY_CONSUME 1
///If the structure is used/deleted in the crafting process
#define CRAFTING_STRUCTURE_CONSUME 1
///If the machine is only "used" i.e. it checks to see if it's nearby and allows crafting, but doesn't delete it
#define CRAFTING_MACHINERY_USE 0
///If the structure is only "used" i.e. it checks to see if it's nearby and allows crafting, but doesn't delete it
#define CRAFTING_STRUCTURE_USE 0
File renamed without changes.
6 changes: 6 additions & 0 deletions code/__DEFINES/deadchat_control.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
///Will execute a single command after the cooldown based on player votes.
#define DEMOCRACY_MODE (1<<0)
///Allows each player to do a single command every cooldown.
#define ANARCHY_MODE (1<<1)
///Mutes the democracy mode messages send to orbiters at the end of each cycle. Useful for when the cooldown is so low it'd get spammy.
#define MUTE_DEMOCRACY_MESSAGES (1<<2)
9 changes: 9 additions & 0 deletions code/__DEFINES/dynamic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@

/// This cycle, a round event was hijacked when the last midround event was too recent.
#define HIJACKED_TOO_RECENT "HIJACKED_TOO_RECENT"

/// Kill this ruleset from continuing to process
#define RULESET_STOP_PROCESSING 1

/// Requirements when something needs a lot of threat to run, but still possible at low-pop
#define REQUIREMENTS_VERY_HIGH_THREAT_NEEDED list(90,90,90,80,60,50,40,40,40,40)

/// Max number of teams we can have for the abductor ruleset
#define ABDUCTOR_MAX_TEAMS 4
6 changes: 6 additions & 0 deletions code/__DEFINES/explosions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@
#define EXPLODABLE_DELETE_SELF 1
/// Makes the explodable component delete its parent when it detonates.
#define EXPLODABLE_DELETE_PARENT 2

// Flags for [/obj/item/grenade/var/dud_flags]
/// The grenade cannot detonate at all. It is innately nonfunctional.
#define GRENADE_DUD (1<<0)
/// The grenade has been used and as such cannot detonate.
#define GRENADE_USED (1<<1)
4 changes: 4 additions & 0 deletions code/__DEFINES/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,7 @@ DEFINE_BITFIELD(food_flags, list(
#define ICE_CREAM_SCOOP_OFFSET 4

#define BLACKBOX_LOG_FOOD_MADE(food) SSblackbox.record_feedback("tally", "food_made", 1, food)

// Venues for the barbots.
#define VENUE_RESTAURANT "Restaurant Venue"
#define VENUE_BAR "Bar Venue"
10 changes: 10 additions & 0 deletions code/__DEFINES/holopads.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#define HOLOPAD_MAX_DIAL_TIME 200

#define HOLORECORD_DELAY "delay"
#define HOLORECORD_SAY "say"
#define HOLORECORD_SOUND "sound"
#define HOLORECORD_LANGUAGE "lang"
#define HOLORECORD_PRESET "preset"
#define HOLORECORD_RENAME "rename"

#define HOLORECORD_MAX_LENGTH 200
17 changes: 17 additions & 0 deletions code/__DEFINES/machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,20 @@

/// What's the minimum duration of a syndie bomb (in seconds)
#define SYNDIEBOMB_MIN_TIMER_SECONDS 90

// Camera upgrade bitflags.
#define CAMERA_UPGRADE_XRAY (1<<0)
#define CAMERA_UPGRADE_EMP_PROOF (1<<1)
#define CAMERA_UPGRADE_MOTION (1<<2)

/// Max length of a status line in the status display
#define MAX_STATUS_LINE_LENGTH 40

/// Blank Status Display
#define SD_BLANK 0
/// Shows the emergency shuttle timer
#define SD_EMERGENCY 1
/// Shows an arbitrary message, user-set
#define SD_MESSAGE 2
/// Shows an alert picture (e.g. red alert, radiation, etc.)
#define SD_PICTURE 3
22 changes: 22 additions & 0 deletions code/__DEFINES/maps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,25 @@ Always compile, always use that verb, and always make sure that it works for wha
#define SHELTER_DEPLOY_ANCHORED_OBJECTS "anchored objects"
/// Shelter spot is out of bounds from the maps x/y coordinates
#define SHELTER_DEPLOY_OUTSIDE_MAP "outside map"

/// A map key that corresponds to being one exclusively for Space.
#define SPACE_KEY "space"

//clusterCheckFlags defines
//All based on clusterMin and clusterMax as guides

//Individual defines
#define CLUSTER_CHECK_NONE 0 //!No checks are done, cluster as much as possible
#define CLUSTER_CHECK_DIFFERENT_TURFS (1<<1) //!Don't let turfs of DIFFERENT types cluster
#define CLUSTER_CHECK_DIFFERENT_ATOMS (1<<2) //!Don't let atoms of DIFFERENT types cluster
#define CLUSTER_CHECK_SAME_TURFS (1<<3) //!Don't let turfs of the SAME type cluster
#define CLUSTER_CHECK_SAME_ATOMS (1<<4) //!Don't let atoms of the SAME type cluster

//Combined defines
#define CLUSTER_CHECK_SAMES 24 //!Don't let any of the same type cluster
#define CLUSTER_CHECK_DIFFERENTS 6 //!Don't let any of different types cluster
#define CLUSTER_CHECK_ALL_TURFS 10 //!Don't let ANY turfs cluster same and different types
#define CLUSTER_CHECK_ALL_ATOMS 20 //!Don't let ANY atoms cluster same and different types

//All
#define CLUSTER_CHECK_ALL 30 //!Don't let anything cluster, like, at all
3 changes: 3 additions & 0 deletions code/__DEFINES/melee.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
#define MARTIALART_PSYCHOBRAWL "psychotic brawling"
#define MARTIALART_SLEEPINGCARP "sleeping carp"
#define MARTIALART_WRESTLING "wrestling"

/// The number of hits required to crit a target
#define HITS_TO_CRIT(damage) round(100 / damage, 0.1)
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
#define CLOTHING_NUTRITION_GAIN 15
#define REAGENTS_METABOLISM 0.2 //How many units of reagent are consumed per second, by default.
#define REAGENTS_EFFECT_MULTIPLIER (REAGENTS_METABOLISM / 0.4) // By defining the effect multiplier this way, it'll exactly adjust all effects according to how they originally were with the 0.4 metabolism
#define REM REAGENTS_EFFECT_MULTIPLIER //! Shorthand for the above define for ease of use in equations and the like

// Eye protection
#define FLASH_PROTECTION_HYPER_SENSITIVE -2
Expand Down
14 changes: 14 additions & 0 deletions code/__DEFINES/projectiles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,17 @@
#define CALIBER_HOOK "hook"
/// The caliber used by the changeling tentacle mutation.
#define CALIBER_TENTACLE "tentacle"

/// For gunpoints, how many tiles around the target the shooter can roam without losing their shot
#define GUNPOINT_SHOOTER_STRAY_RANGE 2

//Designed for things that need precision trajectories like projectiles.
//Don't use this for anything that you don't absolutely have to use this with (like projectiles!) because it isn't worth using a datum unless you need accuracy down to decimal places in pixels.

//You might see places where it does - 16 - 1. This is intentionally 17 instead of 16, because of how byond's tiles work and how not doing it will result in rounding errors like things getting put on the wrong turf.

#define RETURN_PRECISE_POSITION(A) new /datum/position(A)
#define RETURN_PRECISE_POINT(A) new /datum/point(A)

#define RETURN_POINT_VECTOR(ATOM, ANGLE, SPEED) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED))
#define RETURN_POINT_VECTOR_INCREMENT(ATOM, ANGLE, SPEED, AMT) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED, AMT))
7 changes: 7 additions & 0 deletions code/__DEFINES/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@
/// This reaction is produces a product that affects plants
#define REACTION_TAG_COMPETITIVE (1<<21)

#define RNGCHEM_INPUT "input"
#define RNGCHEM_CATALYSTS "catalysts"
#define RNGCHEM_OUTPUT "output"

/// Below are defines used for reagent associated machines only
/// For the pH meter flashing method
#define ENABLE_FLASHING -1
Expand All @@ -190,6 +194,9 @@

#define GOLDSCHLAGER_GOLD_RATIO (GOLDSCHLAGER_GOLD/(GOLDSCHLAGER_VODKA+GOLDSCHLAGER_GOLD))

/// The rate at which alcohol affects the drinker
#define ALCOHOL_RATE 0.005

#define BLASTOFF_DANCE_MOVE_CHANCE_PER_UNIT 3
#define BLASTOFF_DANCE_MOVES_PER_SUPER_MOVE 3

Expand Down
17 changes: 17 additions & 0 deletions code/__DEFINES/rotation.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/// If an object needs to be rotated with a wrench
#define ROTATION_REQUIRE_WRENCH (1<<0)
/// If ghosts can rotate an object (if the ghost config is enabled)
#define ROTATION_GHOSTS_ALLOWED (1<<1)
/// If an object will ignore anchored for rotation (used for chairs)
#define ROTATION_IGNORE_ANCHORED (1<<2)
/// If an object will omit flipping from rotation (used for pipes since they use custom handling)
#define ROTATION_NO_FLIPPING (1<<3)
/// If an object needs to have an empty spot available in target direction (used for windoors and railings)
#define ROTATION_NEEDS_ROOM (1<<4)

/// Rotate an object clockwise
#define ROTATION_CLOCKWISE -90
/// Rotate an object counterclockwise
#define ROTATION_COUNTERCLOCKWISE 90
/// Rotate an object upside down
#define ROTATION_FLIP 180
3 changes: 3 additions & 0 deletions code/__DEFINES/station_stuck.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define PUNISHMENT_MURDER "murder"
#define PUNISHMENT_GIB "gib"
#define PUNISHMENT_TELEPORT "teleport"
7 changes: 7 additions & 0 deletions code/__DEFINES/supply_pods.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#define MAX_EMAG_ROCKETS 5
#define BEACON_COST 500
#define SP_LINKED 1
#define SP_READY 2
#define SP_LAUNCH 3
#define SP_UNLINK 4
#define SP_UNREADY 5
5 changes: 5 additions & 0 deletions code/__DEFINES/weather.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
//A reference to this list is passed into area sound managers, and it's modified in a manner that preserves that reference in ash_storm.dm
GLOBAL_LIST_EMPTY(ash_storm_sounds)

#define STARTUP_STAGE 1
#define MAIN_STAGE 2
#define WIND_DOWN_STAGE 3
#define END_STAGE 4
6 changes: 6 additions & 0 deletions code/__DEFINES/wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@
#define WIRE_ZAP "High Voltage Circuit"
#define WIRE_ZAP1 "High Voltage Circuit 1"
#define WIRE_ZAP2 "High Voltage Circuit 2"

// Wire states for the AI
#define AI_WIRE_NORMAL 0
#define AI_WIRE_DISABLED 1
#define AI_WIRE_HACKED 2
#define AI_WIRE_DISABLED_HACKED -1
3 changes: 3 additions & 0 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -578,3 +578,6 @@
return TRUE

return FALSE

#undef MAX_SAFE_BYOND_ICON_SCALE_TILES
#undef MAX_SAFE_BYOND_ICON_SCALE_PX
3 changes: 3 additions & 0 deletions code/_onclick/drag_drop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,6 @@
..()
drag_start = 0
drag_details = null

#undef LENIENCY_DISTANCE
#undef LENIENCY_TIME
6 changes: 6 additions & 0 deletions code/_onclick/hud/credits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@

/atom/movable/screen/credit/proc/FadeOut()
animate(src, alpha = 0, transform = target, time = CREDIT_EASE_DURATION)

#undef CREDIT_ANIMATE_HEIGHT
#undef CREDIT_EASE_DURATION
#undef CREDIT_ROLL_SPEED
#undef CREDIT_SPAWN_SPEED
#undef CREDITS_PATH
3 changes: 3 additions & 0 deletions code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -395,3 +395,6 @@ GLOBAL_LIST_EMPTY(radial_menus)
/datum/radial_menu_choice/Destroy(force, ...)
. = ..()
QDEL_NULL(image)

#undef NEXT_PAGE_ID
#undef DEFAULT_CHECK_DELAY
7 changes: 0 additions & 7 deletions code/controllers/configuration/config_entry.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
#define VALUE_MODE_NUM 0
#define VALUE_MODE_TEXT 1
#define VALUE_MODE_FLAG 2

#define KEY_MODE_TEXT 0
#define KEY_MODE_TYPE 1

/datum/config_entry
/// Read-only, this is determined by the last portion of the derived entry type
var/name
Expand Down
2 changes: 2 additions & 0 deletions code/controllers/subsystem/area_contents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ SUBSYSTEM_DEF(area_contents)

clear.turfs_to_uncontain = list()
marked_for_clearing.len--

#undef ALLOWED_LOOSE_TURFS
Loading

0 comments on commit e4b4d4d

Please sign in to comment.