From 425f39a4e3a0d0a4f98eb8b165d1cca37499d12a Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 29 Mar 2006 19:10:27 +0000 Subject: - Now none of the pet-menu options will have any effect when the pet's intimacy is 0. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5801 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ src/map/pet.c | 28 +++++++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 10d780974..8bae872c0 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/03/29 + * Now none of the pet-menu options will have any effect when the pet's + intimacy is 0. [Skotlex] * Applied a fix to not do range checks on npc_doevent when the npc is not on a map. [Skotlex] * You can't return to egg a pet that has run away now. [Skotlex] diff --git a/src/map/pet.c b/src/map/pet.c index 0dced634d..00994c723 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -361,8 +361,7 @@ int pet_return_egg(struct map_session_data *sd) if(sd->status.pet_id && sd->pd) { // ルートしたItemを落とさせる pet_lootitem_drop(sd->pd,sd); - //Avoid returning to egg those pets that already ran away. [Skotlex] - if(sd->petDB == NULL || sd->pet.intimate <= 0) + if(sd->petDB == NULL) return 1; memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = sd->petDB->EggID; @@ -693,6 +692,10 @@ int pet_menu(struct map_session_data *sd,int menunum) if (sd->pd == NULL) return 1; + //You lost the pet already. + if(sd->pet.intimate <= 0) + return 1; + switch(menunum) { case 0: clif_send_petstatus(sd); @@ -823,7 +826,7 @@ int pet_unequipitem(struct map_session_data *sd) int pet_food(struct map_session_data *sd) { - int i,k,t; + int i,k; nullpo_retr(1, sd); @@ -835,24 +838,19 @@ int pet_food(struct map_session_data *sd) return 1; } pc_delitem(sd,i,1,0); - t = sd->pet.intimate; + if(sd->pet.hungry > 90) sd->pet.intimate -= sd->petDB->r_full; - else if(sd->pet.hungry > 75) { - if(battle_config.pet_friendly_rate != 100) - k = (sd->petDB->r_hungry * battle_config.pet_friendly_rate)/100; - else - k = sd->petDB->r_hungry; - k = k >> 1; - if(k <= 0) - k = 1; - sd->pet.intimate += k; - } else { if(battle_config.pet_friendly_rate != 100) k = (sd->petDB->r_hungry * battle_config.pet_friendly_rate)/100; else k = sd->petDB->r_hungry; + if(sd->pet.hungry > 75) { + k = k >> 1; + if(k <= 0) + k = 1; + } sd->pet.intimate += k; } if(sd->pet.intimate <= 0) { @@ -860,7 +858,7 @@ int pet_food(struct map_session_data *sd) pet_stop_attack(sd->pd); sd->pd->speed = sd->pd->db->speed; - if(battle_config.pet_status_support && t > 0) { + if(battle_config.pet_status_support) { if(sd->bl.prev != NULL) status_calc_pc(sd,0); else -- cgit v1.2.3-70-g09d2