summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-04-14 01:24:40 +0200
committerJesusaves <cpntb1@ymail.com>2021-02-15 16:53:56 -0300
commit283ad82ad91a9029993e69f2e898640f647204d0 (patch)
treea3b321a12d79fd62a9db452c5a07cbc91f39616f
parentc2b6d6d0b2664b9600155a4fb73d236e8d03d55f (diff)
downloadhercules-283ad82ad91a9029993e69f2e898640f647204d0.tar.gz
hercules-283ad82ad91a9029993e69f2e898640f647204d0.tar.bz2
hercules-283ad82ad91a9029993e69f2e898640f647204d0.tar.xz
hercules-283ad82ad91a9029993e69f2e898640f647204d0.zip
Apply code style to pet_ai_sub_foreachclient()
-rw-r--r--src/map/pet.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 3374737f4..5ecc82962 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -1032,12 +1032,22 @@ static int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int
return 0;
}
+/**
+ * Calls pet_ai_sub_hard() for a character's pet if conditions are fulfilled.
+ *
+ * @param sd The character.
+ * @param ap Additional arguments. In this case only the time stamp of pet AI timer execution.
+ * @return Always 0.
+ *
+ **/
static int pet_ai_sub_foreachclient(struct map_session_data *sd, va_list ap)
{
- int64 tick = va_arg(ap,int64);
nullpo_ret(sd);
+
+ int64 tick = va_arg(ap, int64);
+
if (sd->bl.prev != NULL && sd->status.pet_id != 0 && sd->pd != NULL && sd->pd->bl.prev != NULL)
- pet->ai_sub_hard(sd->pd,sd,tick);
+ pet->ai_sub_hard(sd->pd, sd, tick);
return 0;
}