mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Wraps lowertext() to ensure proper stringification. (#82442)
## About The Pull Request Fixes #82440 This PR just creates a new macro, `LOWER_TEXT()` (yes the irony is not lost on me) to wrap around all calls of `lowertext()` and ensure that whatever we input into that proc will be stringified using the `"[]"` (or `tostring()` for the nerds) operator. very simple. I also added a linter to enforce this (and prevent all forms of regression) because I think that machines should do the menial work and we shouldn't expect maintainers to remember this, let me know if you disagree. if there is a time when it should be opted out for some reason, the linter does respect it if you wrap your input with the `UNLINT()` function.
This commit is contained in:
@@ -88,7 +88,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
var/use_rare_music = prob(1)
|
||||
|
||||
for(var/S in provisional_title_music)
|
||||
var/lower = lowertext(S)
|
||||
var/lower = LOWER_TEXT(S)
|
||||
var/list/L = splittext(lower,"+")
|
||||
switch(L.len)
|
||||
if(3) //rare+MAP+sound.ogg or MAP+rare.sound.ogg -- Rare Map-specific sounds
|
||||
@@ -112,7 +112,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
for(var/S in music)
|
||||
var/list/L = splittext(S,".")
|
||||
if(L.len >= 2)
|
||||
var/ext = lowertext(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here
|
||||
var/ext = LOWER_TEXT(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here
|
||||
if(byond_sound_formats[ext])
|
||||
continue
|
||||
music -= S
|
||||
|
||||
@@ -25,7 +25,7 @@ SUBSYSTEM_DEF(title)
|
||||
|
||||
for(var/S in provisional_title_screens)
|
||||
var/list/L = splittext(S,"+")
|
||||
if((L.len == 1 && (L[1] != "exclude" && L[1] != "blank.png")) || (L.len > 1 && ((use_rare_screens && lowertext(L[1]) == "rare") || (lowertext(L[1]) == lowertext(SSmapping.config.map_name)))))
|
||||
if((L.len == 1 && (L[1] != "exclude" && L[1] != "blank.png")) || (L.len > 1 && ((use_rare_screens && LOWER_TEXT(L[1]) == "rare") || (LOWER_TEXT(L[1]) == LOWER_TEXT(SSmapping.config.map_name)))))
|
||||
title_screens += S
|
||||
|
||||
if(length(title_screens))
|
||||
|
||||
Reference in New Issue
Block a user