summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c7
-rw-r--r--src/map/clif.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index c19164d1a..c339407dc 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6177,6 +6177,13 @@ ACMD_FUNC(pettalk)
ARR_FIND( 0, ARRAYLENGTH(emo), i, stricmp(message, emo[i]) == 0 );
if( i < ARRAYLENGTH(emo) )
{
+ if (sd->emotionlasttime + 1 >= time(NULL)) { // not more than 1 per second
+ sd->emotionlasttime = time(NULL);
+ clif_skill_fail(sd, 1, 0, 1);
+ return 0;
+ }
+ sd->emotionlasttime = time(NULL);
+
clif_emotion(&pd->bl, i);
return 0;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index bfe78a58d..b969624df 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9611,12 +9611,12 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd)
return;
}
// fix flood of emotion icon (ro-proxy): flood only the hacker player
- if (sd->emotionlasttime >= time(NULL)) {
- sd->emotionlasttime = time(NULL) + 1; // not more than 1 per second (using /commands the client can spam it)
+ if (sd->emotionlasttime + 1 >= time(NULL)) { // not more than 1 per second
+ sd->emotionlasttime = time(NULL);
clif_skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1);
return;
}
- sd->emotionlasttime = time(NULL) + 1; // not more than 1 per second (using /commands the client can spam it)
+ sd->emotionlasttime = time(NULL);
if(battle_config.client_reshuffle_dice && emoticon>=E_DICE1 && emoticon<=E_DICE6)
{// re-roll dice