From 283ad82ad91a9029993e69f2e898640f647204d0 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Tue, 14 Apr 2020 01:24:40 +0200 Subject: Apply code style to pet_ai_sub_foreachclient() --- src/map/pet.c | 14 ++++++++++++-- 1 file 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; } -- cgit v1.2.3-60-g2f50