summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 05:16:46 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 05:16:46 +0200
commit6f4439ee2182dd3421ff50c7b479c1b9e7f02fcb (patch)
tree81c6bf34b15fef832088ba85d74c99418559a98d
parent18bccc7a437fb11dd65a87b860c0183308306c1b (diff)
downloadhercules-6f4439ee2182dd3421ff50c7b479c1b9e7f02fcb.tar.gz
hercules-6f4439ee2182dd3421ff50c7b479c1b9e7f02fcb.tar.bz2
hercules-6f4439ee2182dd3421ff50c7b479c1b9e7f02fcb.tar.xz
hercules-6f4439ee2182dd3421ff50c7b479c1b9e7f02fcb.zip
Remove/move unnecessarily calling clif_send_petstatus()
-rw-r--r--src/map/atcommand.c8
-rw-r--r--src/map/pet.c1
-rw-r--r--src/map/script.c3
3 files changed, 4 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 3b4334275..9d5c601bf 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2810,10 +2810,8 @@ ACMD(petfriendly)
return false;
}
- if (friendly != pd->pet.intimate) { // No need to update the pet's status if intimacy value won't change.
+ if (friendly != pd->pet.intimate) // No need to update the pet's status if intimacy value won't change.
pet->set_intimate(pd, friendly);
- clif->send_petstatus(sd);
- }
clif->message(fd, msg_fd(fd, 182)); // Pet intimacy changed. (Send message regardless of value has changed or not.)
@@ -2854,10 +2852,8 @@ ACMD(pethungry)
return false;
}
- if (hungry != pd->pet.hungry) { // No need to update the pet's status if hunger value won't change.
+ if (hungry != pd->pet.hungry) // No need to update the pet's status if hunger value won't change.
pet->set_hunger(pd, hungry);
- clif->send_petstatus(sd);
- }
clif->message(fd, msg_fd(fd, 185)); // Pet hunger changed. (Send message regardless of value has changed or not.)
diff --git a/src/map/pet.c b/src/map/pet.c
index 9c7a1aab4..da93906ae 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -884,7 +884,6 @@ static int pet_change_name_ack(struct map_session_data *sd, const char *name, in
aFree(newname);
clif->blname_ack(0,&pd->bl);
pd->pet.rename_flag = 1;
- clif->send_petstatus(sd);
return 1;
}
diff --git a/src/map/script.c b/src/map/script.c
index d501818d9..3da0cdceb 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -20518,6 +20518,8 @@ static BUILDIN(setunitdata)
break;
case UDT_LEVEL:
pd->pet.level = (short)val;
+ if (pd->msd != NULL)
+ clif->send_petstatus(pd->msd); // Send pet data.
break;
case UDT_HP:
status->set_hp(bl, (unsigned int)val, STATUS_HEAL_DEFAULT);
@@ -20639,7 +20641,6 @@ static BUILDIN(setunitdata)
return false;
}
- clif->send_petstatus(pd->msd); // Send pet data.
break;
}
case BL_MER: {