Fix can_speak check in megaphone

The original check actually made no sense, but worked because it returned false every time as there was never a message passed through
This commit is contained in:
Orange Borg
2015-04-05 20:29:07 +12:00
parent 6550016ee6
commit a5306ba1e0
+8 -4
View File
@@ -17,12 +17,11 @@
if(user.client.prefs.muted & MUTE_IC)
src << "<span class='warning'>You cannot speak in IC (muted).</span>"
return
if(!ishuman(user))
user << "<span class='warning'>You don't know how to use this!</span>"
return
if(user.can_speak())
user << "<span class='warning'>You find yourself unable to speak at all.</span>"
return
if(spamcheck > world.time)
user << "<span class='warning'>\The [src] needs to recharge!</span>"
return
@@ -30,7 +29,12 @@
var/message = copytext(sanitize(input(user, "Shout a message?", "Megaphone", null) as text),1,MAX_MESSAGE_LEN)
if(!message)
return
message = capitalize(message)
if(!user.can_speak(message))
user << "<span class='warning'>You find yourself unable to speak at all.</span>"
return
if ((src.loc == user && user.stat == 0))
if(emagged)
if(insults)
@@ -60,4 +64,4 @@
/obj/item/device/megaphone/cargo
name = "supply megaphone"
icon_state = "megaphone-cargo"
icon_state = "megaphone-cargo"