mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Merge pull request #40517 from ShizCalev/instrument-stat
Fixes instruments not checking stat after inputs
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user