From 3ac2c090daf88308539997284276608bb3be89fc Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Wed, 26 Sep 2018 13:26:53 -0400 Subject: [PATCH] Fixes instruments not checking stat after inputs --- code/game/objects/structures/musician.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 6d3f498a8ca..c99d627a64b 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -82,7 +82,7 @@ /datum/song/proc/shouldStopPlaying(mob/user) if(instrumentObj) - if(!user.canUseTopic(instrumentObj)) + if(!user.canUseTopic(instrumentObj, BE_CLOSE, FALSE, NO_TK)) return TRUE return !instrumentObj.anchored // add special cases to stop in subclasses else @@ -217,7 +217,7 @@ updateDialog(usr) // make sure updates when complete /datum/song/Topic(href, href_list) - if(!usr.canUseTopic(instrumentObj)) + if(!usr.canUseTopic(instrumentObj, BE_CLOSE, FALSE, NO_TK)) usr << browse(null, "window=instrument") usr.unset_machine() return @@ -233,11 +233,13 @@ var/t = "" do t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message) - if(!in_range(instrumentObj, usr)) + if(!usr.canUseTopic(instrumentObj, BE_CLOSE, FALSE, NO_TK)) return if(lentext(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS) var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") + if(!usr.canUseTopic(instrumentObj, BE_CLOSE, FALSE, NO_TK)) + return if(cont == "no") break while(lentext(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS) @@ -268,7 +270,7 @@ else if(href_list["newline"]) var/newline = html_encode(input("Enter your line: ", instrumentObj.name) as text|null) - if(!newline || !in_range(instrumentObj, usr)) + if(!newline || !usr.canUseTopic(instrumentObj, BE_CLOSE, FALSE, NO_TK)) return if(lines.len > MUSIC_MAXLINES) return @@ -285,7 +287,7 @@ else if(href_list["modifyline"]) var/num = round(text2num(href_list["modifyline"]),1) var/content = html_encode(input("Enter your line: ", instrumentObj.name, lines[num]) as text|null) - if(!content || !in_range(instrumentObj, usr)) + if(!content || !usr.canUseTopic(instrumentObj, BE_CLOSE, FALSE, NO_TK)) return if(lentext(content) > MUSIC_MAXLINECHARS) content = copytext(content, 1, MUSIC_MAXLINECHARS)