summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-14 23:10:45 +0100
committerHaru <haru@dotalux.com>2020-04-05 21:20:35 +0200
commite8c9e3a5b381b6d52234f26ea2dc18836b02c5bc (patch)
treefb7f83026419b739ab5b6d8ce7bd8108bb3058f5 /src/map/pet.c
parenta87d1f791455ac29f60e4b6e0c1b236df7baa595 (diff)
downloadhercules-e8c9e3a5b381b6d52234f26ea2dc18836b02c5bc.tar.gz
hercules-e8c9e3a5b381b6d52234f26ea2dc18836b02c5bc.tar.bz2
hercules-e8c9e3a5b381b6d52234f26ea2dc18836b02c5bc.tar.xz
hercules-e8c9e3a5b381b6d52234f26ea2dc18836b02c5bc.zip
Add a base rate validation to pet_target_check() function
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 642bb0873..045c82eea 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -172,6 +172,9 @@ static int pet_target_check(struct map_session_data *sd, struct block_list *bl,
Assert_ret(pd->msd == 0 || pd->msd->pd == pd);
+ if (pd->petDB != NULL && ((type == 0 && pd->petDB->attack_rate == 0) || (type != 0 && pd->petDB->defence_attack_rate == 0)))
+ return 0; // If base rate is 0, there's nothing to do.
+
if( bl == NULL || bl->type != BL_MOB || bl->prev == NULL
|| pd->pet.intimate < battle_config.pet_support_min_friendly
|| pd->pet.hungry <= PET_HUNGER_STARVING