Skip to content

Commit

Permalink
Unsorted cleanup (#6352)
Browse files Browse the repository at this point in the history
# About the pull request

Cleans up some duplicate, unused, and/or obsolete (due to native DM
implementation) code in `unsorted.dm`.

Removed (unused):
- `is_hot`
- `sign`
- `rename_self`
- `get_sorted_mobs` (`sortmobs` is the one you're thinking of)
- `getxenos`
- `getpreds`
- `gethumans`
- `getsurvivors`
- `getertmembers`
- `get_holograms`
- `sortxenos`
- `sortpreds`
- `sorthumans`
- `sortsurvivors`
- `sortertmembers`
- `blockhollow`
- `get_random_zero_sum_variances`
- `IsValidSrc`
- `convert_to_json_text`

Replaced (functionally identical):
- `InRange` to `ISINRANGE`
- `between`, `dd_range` to `clamp` (only difference was argument order)
- `check_bitflag` to `HAS_FLAG`

Replaced (special):
- `getsynths`, `sortsynths` were only used once for MOOC, which only
really needed `GLOB.human_mob_list` filtered by `issynth()`

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game

Less duplication leads to greater maintainability.
# Testing Photographs and Procedure
Boots without issue.


# Changelog
No player-facing changes.
  • Loading branch information
Doubleumc authored Jun 4, 2024
1 parent 68a60af commit 74e6e74
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 427 deletions.
2 changes: 1 addition & 1 deletion code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/proc/listgetindex(list/list,index)
if(istype(list) && list.len)
if(isnum(index))
if(InRange(index,1,list.len))
if(ISINRANGE(index,1,list.len))
return list[index]
else if(list[index])
return list[index]
Expand Down
Loading

0 comments on commit 74e6e74

Please sign in to comment.