Browse Source

- Now none of the pet-menu options will have any effect when the pet's intimacy is 0.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5801 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 years ago
parent
commit
63382fd345
2 changed files with 15 additions and 15 deletions
  1. 2 0
      Changelog-Trunk.txt
  2. 13 15
      src/map/pet.c

+ 2 - 0
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]

+ 13 - 15
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