summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-16 07:19:46 +0100
committerHaru <haru@dotalux.com>2020-04-05 21:26:11 +0200
commiteaec5f9fbf0fb0c25c73ce03c61b9bfa8ec988d1 (patch)
tree4c95a3fafa8a151c9b8b7a0c6624a89096c21bb3
parent48daed792b6329fdaf384ccf89fbe17cc5d1666e (diff)
downloadhercules-eaec5f9fbf0fb0c25c73ce03c61b9bfa8ec988d1.tar.gz
hercules-eaec5f9fbf0fb0c25c73ce03c61b9bfa8ec988d1.tar.bz2
hercules-eaec5f9fbf0fb0c25c73ce03c61b9bfa8ec988d1.tar.xz
hercules-eaec5f9fbf0fb0c25c73ce03c61b9bfa8ec988d1.zip
Apply code style to pet_performance() function
-rw-r--r--src/map/pet.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index c77e20094..6c490ee1d 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -361,21 +361,31 @@ static int pet_hungry_timer_delete(struct pet_data *pd)
return 1;
}
+/**
+ * Makes a pet start performing/dancing.
+ *
+ * @param sd Unused.
+ * @param pd The pet.
+ * @return 0 on failure, 1 on success.
+ *
+ **/
static int pet_performance(struct map_session_data *sd, struct pet_data *pd)
{
+ nullpo_ret(pd);
+
int val;
- nullpo_retr(1, pd);
if (pd->pet.intimate > PET_INTIMACY_LOYAL)
- val = (pd->petDB->s_perfor > 0)? 4:3;
- else if (pd->pet.intimate > PET_INTIMACY_CORDIAL) //TODO: this is way too high
+ val = (pd->petDB->s_perfor > 0) ? 4 : 3;
+ else if (pd->pet.intimate > PET_INTIMACY_CORDIAL) //TODO: This is way too high.
val = 2;
else
val = 1;
- pet_stop_walking(pd,STOPWALKING_FLAG_NONE | (2000<<8)); // Stop walking for 2000ms
- clif->send_petdata(NULL, pd, 4, rnd()%val + 1);
- pet->lootitem_drop(pd,NULL);
+ pet_stop_walking(pd, STOPWALKING_FLAG_NONE | (2000 << 8)); // Stop walking for 2 seconds.
+ clif->send_petdata(NULL, pd, 4, rnd() % val + 1);
+ pet->lootitem_drop(pd, NULL);
+
return 1;
}