From a87d1f791455ac29f60e4b6e0c1b236df7baa595 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Fri, 14 Feb 2020 22:51:21 +0100 Subject: Add a HungerDelay validation to pet_hungry() function --- src/map/pet.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/map/pet.c b/src/map/pet.c index af18059c4..642bb0873 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -240,6 +240,17 @@ static int pet_hungry(int tid, int64 tick, int id, intptr_t data) return 1; pd = sd->pd; + + /** + * If HungerDelay is 0, there's nothing to do. + * Actually this shouldn't happen, since the timer wasn't added in pet_data_init(), but just to be sure... + * + **/ + if (pd->petDB != NULL && pd->petDB->hungry_delay == 0) { + pet->hungry_timer_delete(pd); + return 0; + } + if(pd->pet_hungry_timer != tid){ ShowError("pet_hungry_timer %d != %d\n",pd->pet_hungry_timer,tid); return 0; -- cgit v1.2.3-70-g09d2