ソースを参照

- Rewrote/cleaned up @petfriendly.
- Cleaned up final part of status_calc_pc (flags 2/4 do not exist)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6857 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 年 前
コミット
ba6216e43e
4 ファイル変更17 行追加44 行削除
  1. 2 0
      Changelog-Trunk.txt
  2. 0 1
      db/const.txt
  3. 15 27
      src/map/atcommand.c
  4. 0 16
      src/map/status.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/05/30
+	* Rewrote/cleaned up @petfriendly. [Skotlex]
+	* Cleaned up final part of status_calc_pc (flags 2/4 do not exist) [Skotlex]
 	* Updated attr_fix_table reading code to account for ELE_MAX (will
 	  correctly read bigger elemental tables if ELE_MAX is changed) [Skotlex]
 	* Aggressive mobs will now use battle_check_range rather than mob_can_reach

+ 0 - 1
db/const.txt

@@ -389,7 +389,6 @@ IG_EggBoy	32
 IG_EggGirl	33
 IG_GiftBoxChina	34
 
-
 SC_STONE	0
 SC_FREEZE	1
 SC_STAN	2

+ 15 - 27
src/map/atcommand.c

@@ -4402,7 +4402,6 @@ int atcommand_petfriendly(
 	const char* command, const char* message)
 {
 	int friendly;
-	int t;
 	nullpo_retr(-1, sd);
 
 	if (!message || !*message || (friendly = atoi(message)) < 0) {
@@ -4410,35 +4409,24 @@ int atcommand_petfriendly(
 		return -1;
 	}
 
-	if (sd->status.pet_id > 0 && sd->pd) {
-		if (friendly >= 0 && friendly <= 1000) {
-			if (friendly != sd->pet.intimate) {
-				t = sd->pet.intimate;
-				sd->pet.intimate = friendly;
-				clif_send_petstatus(sd);
-				if (battle_config.pet_status_support) {
-					if ((sd->pet.intimate > 0 && t <= 0) ||
-					    (sd->pet.intimate <= 0 && t > 0)) {
-						if (sd->bl.prev != NULL)
-							status_calc_pc(sd, 0);
-						else
-							status_calc_pc(sd, 2);
-					}
-				}
-				clif_displaymessage(fd, msg_table[182]); // Pet friendly value changed!
-			} else {
-				clif_displaymessage(fd, msg_table[183]); // Pet friendly is already the good value.
-				return -1;
-			}
-		} else {
-			clif_displaymessage(fd, msg_table[37]); // An invalid number was specified.
-			return -1;
-		}
-	} else {
+	if (!sd->pd) {
 		clif_displaymessage(fd, msg_table[184]); // Sorry, but you have no pet.
 		return -1;
 	}
-
+	
+	if (friendly < 0 || friendly > 1000)
+	{
+		clif_displaymessage(fd, msg_table[37]); // An invalid number was specified.
+		return -1;
+	}
+	
+	if (friendly == sd->pet.intimate) {
+		clif_displaymessage(fd, msg_table[183]); // Pet friendly is already the good value.
+		return -1;
+	}
+	sd->pet.intimate = friendly;
+	clif_send_petstatus(sd);
+	clif_displaymessage(fd, msg_table[182]); // Pet friendly value changed!
 	return 0;
 }
 

+ 0 - 16
src/map/status.c

@@ -2051,22 +2051,6 @@ int status_calc_pc(struct map_session_data* sd,int first)
 	status = &sd->battle_status; //Need to compare versus this.
 	
 // ----- CLIENT-SIDE REFRESH -----
-	if(first&4) {
-		calculating = 0;
-		return 0;
-	}
-	if(first&3) {
-		clif_updatestatus(sd,SP_SPEED);
-		clif_updatestatus(sd,SP_MAXHP);
-		clif_updatestatus(sd,SP_MAXSP);
-		if(first&1) {
-			clif_updatestatus(sd,SP_HP);
-			clif_updatestatus(sd,SP_SP);
-		}
-		calculating = 0;
-		return 0;
-	}
-
 	if(memcmp(b_skill,sd->status.skill,sizeof(sd->status.skill)))
 		clif_skillinfoblock(sd);
 	if(b_status.speed != status->speed)