浏览代码

- Modified pc_setoption so that it will correctly update sprite AND clothes color when mounting/unmounting changing into/from xmas/wedding sprites.
- Allowed itemdb_exists to return the dummy item. Enables "invalid" items to be sold, traded, dropped, etc.


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

skotlex 19 年之前
父节点
当前提交
95aa55a3e6
共有 3 个文件被更改,包括 23 次插入30 次删除
  1. 5 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/itemdb.c
  3. 17 29
      src/map/pc.c

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ 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/06/23
+	* Modified pc_setoption so that it will correctly update sprite AND clothes
+	  color when mounting/unmounting changing into/from xmas/wedding sprites.
+	  [Skotlex]
+	* Allowed itemdb_exists to return the dummy item. Enables "invalid" items
+	  to be sold, traded, dropped, etc. [Skotlex]
 	* Corrected ASC_BREAKER. Int-based damage is applied after attribute fixes
 	  and before card reductions. The skill now completely disregards left
 	  hand weapon. [Skotlex]

+ 1 - 1
src/map/itemdb.c

@@ -135,7 +135,7 @@ int itemdb_group (int nameid)
 struct item_data* itemdb_exists(int nameid)
 {
 	struct item_data* id = idb_get(item_db,nameid);
-	if (id == &dummy_item) return NULL;
+//	if (id == &dummy_item) return NULL; //Let dummy items go through... technically they "exist" because someone already has them...
 	return id;
 }
 

+ 17 - 29
src/map/pc.c

@@ -5476,7 +5476,7 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
  */
 int pc_setoption(struct map_session_data *sd,int type)
 {
-	int p_type;
+	int p_type, new_look=0;
 	nullpo_retr(0, sd);
 	p_type = sd->sc.option;
 
@@ -5486,20 +5486,13 @@ int pc_setoption(struct map_session_data *sd,int type)
 
 	if (type&OPTION_RIDING && !(p_type&OPTION_RIDING) && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN)
 	{	//We are going to mount. [Skotlex]
-		status_set_viewdata(&sd->bl, sd->status.class_); //Adjust view class.
-		clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
-		if (sd->vd.cloth_color)
-			clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
+		new_look = -1;
 		clif_status_load(&sd->bl,SI_RIDING,1);
 		status_calc_pc(sd,0); //Mounting/Umounting affects walk and attack speeds.
 	}
 	else if (!(type&OPTION_RIDING) && p_type&OPTION_RIDING && (sd->class_&MAPID_BASEMASK) == MAPID_SWORDMAN)
 	{	//We are going to dismount.
-		if (sd->vd.class_ != sd->status.class_) {
-			status_set_viewdata(&sd->bl, sd->status.class_);
-			clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
-			clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
-		}
+		new_look = -1;
 		clif_status_load(&sd->bl,SI_RIDING,0);
 		status_calc_pc(sd,0); //Mounting/Umounting affects walk and attack speeds.
 	}
@@ -5520,33 +5513,28 @@ int pc_setoption(struct map_session_data *sd,int type)
 		clif_status_load(&sd->bl,SI_FALCON,0);
 
 	if (type&OPTION_FLYING && !(p_type&OPTION_FLYING))
-		clif_changelook(&sd->bl,LOOK_BASE,JOB_STAR_GLADIATOR2);
+		new_look = JOB_STAR_GLADIATOR2;
 	else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING)
-	{	
-		status_set_viewdata(&sd->bl, sd->status.class_);
-		clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
-		if(sd->status.clothes_color)
-			clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->status.clothes_color);
-	}
+		new_look = -1;
 	
 	if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING))
-		clif_changelook(&sd->bl,LOOK_BASE,JOB_WEDDING);
+		new_look = JOB_WEDDING;
 	else if (!(type&OPTION_WEDDING) && p_type&OPTION_WEDDING)
-	{	
-		status_set_viewdata(&sd->bl, sd->status.class_);
-		clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
-		if(sd->status.clothes_color)
-			clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->status.clothes_color);
-	}
+		new_look = -1;
 
 	if (type&OPTION_XMAS && !(p_type&OPTION_XMAS))
-		clif_changelook(&sd->bl,LOOK_BASE,JOB_XMAS);
+		new_look = JOB_XMAS;
 	else if (!(type&OPTION_XMAS) && p_type&OPTION_XMAS)
-	{	
+		new_look = -1;
+
+	if (new_look < 0) { //Restore normal look.
 		status_set_viewdata(&sd->bl, sd->status.class_);
-		clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
-		if(sd->status.clothes_color)
-			clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->status.clothes_color);
+		new_look = sd->vd.class_;
+	}
+	if (new_look) {
+		clif_changelook(&sd->bl,LOOK_BASE,new_look);
+		if (sd->vd.cloth_color)
+			clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
 	}
 	return 0;
 }