summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorJedzkie <jedzkie13@rocketmail.com>2015-12-23 23:40:14 +0800
committerJedzkie <jedzkie13@rocketmail.com>2015-12-23 23:40:14 +0800
commitb0326af6dad68fa89f49df5748fcbd04973f7676 (patch)
tree55c49433670261f7f19a9c47b717be545a483273 /src/map/clif.c
parentb4a5a9fc744074ff46a58b5fccfe4a218577385f (diff)
downloadhercules-b0326af6dad68fa89f49df5748fcbd04973f7676.tar.gz
hercules-b0326af6dad68fa89f49df5748fcbd04973f7676.tar.bz2
hercules-b0326af6dad68fa89f49df5748fcbd04973f7676.tar.xz
hercules-b0326af6dad68fa89f49df5748fcbd04973f7676.zip
PetDB Update:
- Change PetID's to Constants - On Official Servers, if you don't have Pet Eggs in your inventory, if you use Pet Incubator item, the Pet Entry list will not show.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 0cf31fccb..687303e38 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6738,29 +6738,30 @@ void clif_pet_roulette(struct map_session_data *sd,int data)
/// Presents a list of pet eggs that can be hatched (ZC_PETEGG_LIST).
/// 01a6 <packet len>.W { <index>.W }*
-void clif_sendegg(struct map_session_data *sd)
-{
- int i,n=0,fd;
+void clif_sendegg(struct map_session_data *sd) {
+ int i, n, fd;
nullpo_retv(sd);
- fd=sd->fd;
+ fd = sd->fd;
if (battle_config.pet_no_gvg && map_flag_gvg2(sd->bl.m)) { //Disable pet hatching in GvG grounds during Guild Wars [Skotlex]
- clif->message(fd, msg_sd(sd,866)); // "Pets are not allowed in Guild Wars."
+ clif->message(fd, msg_sd(sd, 866)); // "Pets are not allowed in Guild Wars."
return;
}
+
WFIFOHEAD(fd, MAX_INVENTORY * 2 + 4);
- WFIFOW(fd,0)=0x1a6;
- for(i=0,n=0;i<MAX_INVENTORY;i++){
- if(sd->status.inventory[i].nameid<=0 || sd->inventory_data[i] == NULL ||
- sd->inventory_data[i]->type!=IT_PETEGG ||
- sd->status.inventory[i].amount<=0)
+ WFIFOW(fd,0) = 0x1a6;
+ for (i = n = 0; i < MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].nameid <= 0 || sd->inventory_data[i] == NULL || sd->inventory_data[i]->type!=IT_PETEGG || sd->status.inventory[i].amount <= 0)
continue;
- WFIFOW(fd,n*2+4)=i+2;
+ WFIFOW(fd, n * 2 + 4) = i + 2;
n++;
}
- WFIFOW(fd,2)=4+n*2;
- WFIFOSET(fd,WFIFOW(fd,2));
+
+ if (!n) return;
+
+ WFIFOW(fd, 2) = 4 + n * 2;
+ WFIFOSET(fd, WFIFOW(fd, 2));
sd->menuskill_id = SA_TAMINGMONSTER;
sd->menuskill_val = -1;