Do not call pet_set_intimate twice (#7702)

This commit is contained in:
Vincent Stumpf 2023-04-15 06:02:41 -07:00 committed by GitHub
parent 22aca36d35
commit a2f4f2bf8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -9680,8 +9680,6 @@ int pc_dead(map_session_data *sd,struct block_list *src)
struct pet_data *pd = sd->pd;
if( !mapdata->flag[MF_NOEXPPENALTY] ) {
pet_set_intimate(pd, pd->pet.intimate + pd->get_pet_db()->die);
if( pd->pet.intimate <= PET_INTIMATE_NONE )
pet_set_intimate(pd, PET_INTIMATE_NONE);
clif_send_petdata(sd,sd->pd,1,pd->pet.intimate);
}
if( sd->pd->target_id ) // Unlock all targets...

View File

@ -629,13 +629,13 @@ int16 pet_get_card3_intimacy( int intimacy ){
/**
* Set the value of the pet's intimacy.
* @param pd : pet requesting
* @param value : new intimacy value
* @param value : new intimacy value. Will be bounded by PET_INTIMATE_NONE and PET_INTIMATE_MAX
*/
void pet_set_intimate(struct pet_data *pd, int value)
{
nullpo_retv(pd);
pd->pet.intimate = min(value, PET_INTIMATE_MAX);
pd->pet.intimate = cap_value(value, PET_INTIMATE_NONE, PET_INTIMATE_MAX);
map_session_data *sd = pd->master;
@ -863,7 +863,6 @@ static TIMER_FUNC(pet_hungry){
pet_set_intimate(pd, pd->pet.intimate + pet_db_ptr->hungry_intimacy_dec);
if( pd->pet.intimate <= PET_INTIMATE_NONE ) {
pet_set_intimate(pd, PET_INTIMATE_NONE);
pd->status.speed = pd->get_pet_walk_speed();
}
@ -1620,7 +1619,6 @@ int pet_food(map_session_data *sd, struct pet_data *pd)
if (pd->pet.hungry > PET_HUNGRY_SATISFIED) {
pet_set_intimate(pd, pd->pet.intimate + pet_db_ptr->r_full);
if (pd->pet.intimate <= PET_INTIMATE_NONE) {
pet_set_intimate(pd, PET_INTIMATE_NONE);
pet_stop_attack(pd);
pd->status.speed = pd->get_pet_walk_speed();
}