playsound vary boolean define conversion (#46254)

About The Pull Request

Converts every single usage of playsound's vary parameter to use the boolean define instead of 1 or 0. I'm tired of people copypasting the incorrect usage.
Also changes a couple of places where a list was picked from instead of using get_sfx internal calls

This was done via regex:
(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\)) to match 1
(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\)) to match 0
full sed commands:
/(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\))/\1TRUE\2/ 1 to TRUE
/(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\))/\1FALSE\2/ 0 to FALSE

I'm not very good with regex and these could probably be optimized, but they worked.
Why It's Good For The Game

Code usability
This commit is contained in:
Rob Bailey
2019-08-30 18:45:20 +12:00
committed by oranges
parent 3bd71a9c44
commit 2029163d33
515 changed files with 1537 additions and 1538 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
/obj/effect/fun_balloon/proc/pop()
visible_message("<span class='notice'>[src] pops!</span>")
playsound(get_turf(src), 'sound/items/party_horn.ogg', 50, 1, -1)
playsound(get_turf(src), 'sound/items/party_horn.ogg', 50, TRUE, -1)
qdel(src)
//ATTACK GHOST IGNORING PARENT RETURN VALUE
+1 -1
View File
@@ -752,4 +752,4 @@
H.equipOutfit(humanoutfit)
var/turf/T = get_step(loc, SOUTHWEST)
flick_overlay_static(portal_appearance, T, 15)
playsound(T, 'sound/magic/lightningbolt.ogg', rand(80, 100), 1)
playsound(T, 'sound/magic/lightningbolt.ogg', rand(80, 100), TRUE)
+1 -1
View File
@@ -49,7 +49,7 @@
log_admin("[key_name(src)] played a local sound [S]")
message_admins("[key_name_admin(src)] played a local sound [S]")
playsound(get_turf(src.mob), S, 50, 0, 0)
playsound(get_turf(src.mob), S, 50, FALSE, FALSE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Local Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/play_web_sound()
+1 -1
View File
@@ -969,7 +969,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
continue
M.audible_message("<span class='italics'>...wabbajack...wabbajack...</span>")
playsound(M.loc, 'sound/magic/staff_change.ogg', 50, 1, -1)
playsound(M.loc, 'sound/magic/staff_change.ogg', 50, TRUE, -1)
wabbajack(M)