diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-28 23:08:42 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-28 23:08:42 +0000 |
commit | c369d1fab6d576c203bbfea30cc619490fe865ce (patch) | |
tree | 34cc39bc8f33a89786e2a75b0e8fcb8ac5096958 /src/map/clif.c | |
parent | f5211cd347e39ea4c97c354006811cd251961687 (diff) | |
download | hercules-c369d1fab6d576c203bbfea30cc619490fe865ce.tar.gz hercules-c369d1fab6d576c203bbfea30cc619490fe865ce.tar.bz2 hercules-c369d1fab6d576c203bbfea30cc619490fe865ce.tar.xz hercules-c369d1fab6d576c203bbfea30cc619490fe865ce.zip |
* Added an option to re-roll the /dice emotion server-side, to prevent cheats during events (bugreport:4194).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14519 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 85b7d8667..51706f431 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9063,8 +9063,10 @@ void clif_parse_ChangeDir(int fd, struct map_session_data *sd) *------------------------------------------*/ void clif_parse_Emotion(int fd, struct map_session_data *sd) { + int emoticon = RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]); + if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, NV_BASIC) >= 2) { - if (RFIFOB(fd,2) == E_MUTE) {// prevent use of the mute emote [Valaris] + if (emoticon == E_MUTE) {// prevent use of the mute emote [Valaris] clif_skill_fail(sd, 1, 0, 1); return; } @@ -9076,7 +9078,12 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd) } sd->emotionlasttime = time(NULL) + 1; // not more than 1 per second (using /commands the client can spam it) - clif_emotion(&sd->bl, RFIFOB(fd,2)); + if(battle_config.client_reshuffle_dice && emoticon>=E_DICE1 && emoticon<=E_DICE6) + {// re-roll dice + emoticon = rand()%6+E_DICE1; + } + + clif_emotion(&sd->bl, emoticon); } else clif_skill_fail(sd, 1, 0, 1); } |