summaryrefslogtreecommitdiff
path: root/src/map/pc.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-05-05 18:18:38 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-05 18:18:38 -0400
commit211b09001aecdc5e1b13016cda39f54ba7aa20e4 (patch)
treebf8ffdf1ca7bdaf6b178d5c4a5bc07c3f86df7c3 /src/map/pc.cpp
parentb155404944cdf3bb500b7d2978fa2ecd34c14c3c (diff)
downloadtmwa-211b09001aecdc5e1b13016cda39f54ba7aa20e4.tar.gz
tmwa-211b09001aecdc5e1b13016cda39f54ba7aa20e4.tar.bz2
tmwa-211b09001aecdc5e1b13016cda39f54ba7aa20e4.tar.xz
tmwa-211b09001aecdc5e1b13016cda39f54ba7aa20e4.zip
add MUTE params
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r--src/map/pc.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 05f61ea..f854ccd 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -827,6 +827,12 @@ int pc_authok(AccountId id, int login_id2, ClientVersion client_version,
sd->chat_repeat_reset_due = tick_t();
sd->chat_lastmsg = RString();
+ // Initialize mute vars
+ sd->mute.global = 0;
+ sd->mute.party = 0;
+ sd->mute.whisper = 0;
+ sd->mute.guild = 0;
+
for (tick_t& t : sd->flood_rates)
t = tick_t();
sd->packet_flood_reset_due = tick_t();
@@ -3547,6 +3553,18 @@ int pc_readparam(dumb_ptr<block_list> bl, SP type)
if (sd)
val = bool(sd->status.option & Opt0::HIDE);
break;
+ case SP::MUTE_GLOBAL:
+ val = sd ? sd->mute.global : 0;
+ break;
+ case SP::MUTE_PARTY:
+ val = sd ? sd->mute.party : 0;
+ break;
+ case SP::MUTE_WHISPER:
+ val = sd ? sd->mute.whisper : 0;
+ break;
+ case SP::MUTE_GUILD:
+ val = sd ? sd->mute.guild : 0;
+ break;
}
return val;
@@ -3770,6 +3788,22 @@ int pc_setparam(dumb_ptr<block_list> bl, SP type, int val)
sd->status.option &= ~Opt0::HIDE;
clif_changeoption(sd);
break;
+ case SP::MUTE_GLOBAL:
+ nullpo_retz(sd);
+ sd->mute.global = (val == 1);
+ break;
+ case SP::MUTE_PARTY:
+ nullpo_retz(sd);
+ sd->mute.party = (val == 1);
+ break;
+ case SP::MUTE_WHISPER:
+ nullpo_retz(sd);
+ sd->mute.whisper = (val == 1);
+ break;
+ case SP::MUTE_GUILD:
+ nullpo_retz(sd);
+ sd->mute.guild = (val == 1);
+ break;
}
return 0;