Don't allow custom /pay messages while muted

This commit is contained in:
UnknownShadow200 2020-05-21 21:00:02 +10:00
parent 3b78863c79
commit 5386ad74b4
2 changed files with 9 additions and 1 deletions

View File

@ -29,6 +29,12 @@ namespace MCGalaxy.Commands.Eco {
bool all = false;
if (!ParseArgs(p, message, ref all, "pay", out trans)) return;
// Player can use /pay messages to bypass a mute
if (trans.Reason != null && !p.CanSpeak()) {
p.Message("%WCannot specify a payment reason, as you cannot currently speak");
return;
}
int matches = 1;
Player who = PlayerInfo.FindMatches(p, trans.TargetName, out matches);
if (matches > 1) return;

View File

@ -313,7 +313,9 @@ namespace MCGalaxy {
#endregion
/// <summary> Returns whether the player is currently allowed to talk. </summary>
public bool CanSpeak() { return !muted && (voice || !Server.chatmod); }
public bool CanSpeak() {
return IsConsole || (!muted && (voice || !Server.chatmod));
}
/// <summary> Blocks calling thread until all 'new map loaded' packets have been sent. </summary>
public void BlockUntilLoad(int sleep) {