浏览代码

- Altered a bit how status_set_viewdata behaves in regards to Wedding/Xmas options.
- Added back OPTION_XMAS, but the actual value is missing!
- Corrected chrif_save so that the player is not set offline on map-change.
- Added change-look support in pc_setoption when specifying OPTION_XMAS
- Fixed clif_parse_RemoveOption removing all options instead of just Falcon/Cart/Peco


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

skotlex 19 年之前
父节点
当前提交
a14314da55
共有 6 个文件被更改,包括 62 次插入35 次删除
  1. 9 0
      Changelog-Trunk.txt
  2. 5 3
      src/map/chrif.c
  3. 4 3
      src/map/clif.c
  4. 14 8
      src/map/pc.c
  5. 12 4
      src/map/status.c
  6. 18 17
      src/map/status.h

+ 9 - 0
Changelog-Trunk.txt

@@ -4,6 +4,15 @@ 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.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2006/06/15
 2006/06/15
+	* Altered a bit how status_set_viewdata behaves in regards to Wedding/Xmas
+	  options. [Skotlex]
+	* Added back OPTION_XMAS, but the actual value is missing! [Skotlex]
+	* Corrected chrif_save so that the player is not set offline on map-change.
+	  [Skotlex]
+	* Added change-look support in pc_setoption when specifying OPTION_XMAS
+	  [Skotlex]
+	* Fixed clif_parse_RemoveOption removing all options instead of just
+	  Falcon/Cart/Peco [Skotlex]
 	* Fixed clif_send not sending packets to SELF when specifying AREA if the
 	* Fixed clif_send not sending packets to SELF when specifying AREA if the
 	  source is not on the map yet. [Skotlex]
 	  source is not on the map yet. [Skotlex]
 	* Fixed and cleaned up script command 'equip' [Skotlex]
 	* Fixed and cleaned up script command 'equip' [Skotlex]

+ 5 - 3
src/map/chrif.c

@@ -175,7 +175,9 @@ int chrif_isconnect(void)
 }
 }
 
 
 /*==========================================
 /*==========================================
- *
+ * Saves char.
+ * Flag = 1: Character is quitting.
+ * Flag = 2: Character is changing map-servers
  *------------------------------------------
  *------------------------------------------
  */
  */
 int chrif_save(struct map_session_data *sd, int flag)
 int chrif_save(struct map_session_data *sd, int flag)
@@ -203,7 +205,7 @@ int chrif_save(struct map_session_data *sd, int flag)
 #ifndef TXT_ONLY
 #ifndef TXT_ONLY
 	if(charsave_method){ //New 'Local' save
 	if(charsave_method){ //New 'Local' save
 		charsave_savechar(sd->char_id, &sd->status);
 		charsave_savechar(sd->char_id, &sd->status);
-		if (flag) chrif_char_offline(sd); //Tell char server that character went offline.
+		if (flag == 1) chrif_char_offline(sd); //Tell char server that character went offline.
 	}else{
 	}else{
 #endif
 #endif
 		WFIFOHEAD(char_fd, sizeof(sd->status) + 13);
 		WFIFOHEAD(char_fd, sizeof(sd->status) + 13);
@@ -211,7 +213,7 @@ int chrif_save(struct map_session_data *sd, int flag)
 		WFIFOW(char_fd,2) = sizeof(sd->status) + 13;
 		WFIFOW(char_fd,2) = sizeof(sd->status) + 13;
 		WFIFOL(char_fd,4) = sd->bl.id;
 		WFIFOL(char_fd,4) = sd->bl.id;
 		WFIFOL(char_fd,8) = sd->char_id;
 		WFIFOL(char_fd,8) = sd->char_id;
-		WFIFOB(char_fd,12) = flag?1:0; //Flag to tell char-server this character is quitting.
+		WFIFOB(char_fd,12) = (flag==1)?1:0; //Flag to tell char-server this character is quitting.
 		memcpy(WFIFOP(char_fd,13), &sd->status, sizeof(sd->status));
 		memcpy(WFIFOP(char_fd,13), &sd->status, sizeof(sd->status));
 		WFIFOSET(char_fd, WFIFOW(char_fd,2));
 		WFIFOSET(char_fd, WFIFOW(char_fd,2));
 #ifndef TXT_ONLY
 #ifndef TXT_ONLY

+ 4 - 3
src/map/clif.c

@@ -2725,10 +2725,10 @@ int clif_changelook(struct block_list *bl,int type,int val)
 			vd->hair_color = val;
 			vd->hair_color = val;
 		break;
 		break;
 		case LOOK_CLOTHES_COLOR:
 		case LOOK_CLOTHES_COLOR:
-			if (
+			if (val && (
 				(vd->class_ == JOB_WEDDING && battle_config.wedding_ignorepalette) ||
 				(vd->class_ == JOB_WEDDING && battle_config.wedding_ignorepalette) ||
 				(vd->class_ == JOB_XMAS && battle_config.xmas_ignorepalette)
 				(vd->class_ == JOB_XMAS && battle_config.xmas_ignorepalette)
-			)
+			))
 				val = 0;
 				val = 0;
 			vd->cloth_color = val;
 			vd->cloth_color = val;
 		break;
 		break;
@@ -9404,7 +9404,8 @@ void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd)
  */
  */
 void clif_parse_RemoveOption(int fd,struct map_session_data *sd)
 void clif_parse_RemoveOption(int fd,struct map_session_data *sd)
 {
 {
-	pc_setoption(sd,0);
+	//Can only remove Cart/Riding/Falcon.
+	pc_setoption(sd,sd->sc.option&~(OPTION_CART|OPTION_RIDING|OPTION_FALCON));
 }
 }
 
 
 /*==========================================
 /*==========================================

+ 14 - 8
src/map/pc.c

@@ -3175,7 +3175,7 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
 					unit_remove_map(&sd->pd->bl, clrtype);
 					unit_remove_map(&sd->pd->bl, clrtype);
 					intif_save_petdata(sd->status.account_id,&sd->pet);
 					intif_save_petdata(sd->status.account_id,&sd->pet);
 				}
 				}
-				chrif_save(sd,1);
+				chrif_save(sd,2);
 				chrif_changemapserver(sd, mapindex, x, y, ip, (short)port);
 				chrif_changemapserver(sd, mapindex, x, y, ip, (short)port);
 				return 0;
 				return 0;
 			}
 			}
@@ -5498,15 +5498,21 @@ int pc_setoption(struct map_session_data *sd,int type)
 		clif_changelook(&sd->bl,LOOK_BASE,JOB_WEDDING);
 		clif_changelook(&sd->bl,LOOK_BASE,JOB_WEDDING);
 	else if (!(type&OPTION_WEDDING) && p_type&OPTION_WEDDING)
 	else if (!(type&OPTION_WEDDING) && p_type&OPTION_WEDDING)
 	{	
 	{	
-		if (sd->vd.class_ != sd->status.class_) {
-			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);
-		}
+		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);
 	}
 	}
 
 
-	clif_changeoption(&sd->bl);
+	if (type&OPTION_XMAS && !(p_type&OPTION_XMAS))
+		clif_changelook(&sd->bl,LOOK_BASE,JOB_XMAS);
+	else if (!(type&OPTION_XMAS) && p_type&OPTION_XMAS)
+	{	
+		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);
+	}
 	return 0;
 	return 0;
 }
 }
 
 

+ 12 - 4
src/map/status.c

@@ -3712,6 +3712,12 @@ void status_set_viewdata(struct block_list *bl, int class_)
 		{
 		{
 			TBL_PC* sd = (TBL_PC*)bl;
 			TBL_PC* sd = (TBL_PC*)bl;
 			if (pcdb_checkid(class_)) {
 			if (pcdb_checkid(class_)) {
+				if (sd->sc.option&OPTION_WEDDING)
+					class_ = JOB_WEDDING;
+				else
+				if (sd->sc.option&OPTION_XMAS)
+					class_ = JOB_XMAS;
+				else
 				if (sd->sc.option&OPTION_RIDING)
 				if (sd->sc.option&OPTION_RIDING)
 				switch (class_)
 				switch (class_)
 				{	//Adapt class to a Mounted one.
 				{	//Adapt class to a Mounted one.
@@ -3734,10 +3740,6 @@ void status_set_viewdata(struct block_list *bl, int class_)
 					class_ = JOB_BABY_CRUSADER2;
 					class_ = JOB_BABY_CRUSADER2;
 					break;
 					break;
 				}
 				}
-				if (class_ == JOB_WEDDING)
-					sd->sc.option|=OPTION_WEDDING;
-				else if (sd->sc.option&OPTION_WEDDING)
-					sd->sc.option&=~OPTION_WEDDING; //If not going to display it, then remove the option.
 				sd->vd.class_ = class_;
 				sd->vd.class_ = class_;
 				clif_get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield);
 				clif_get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield);
 				sd->vd.head_top = sd->status.head_top;
 				sd->vd.head_top = sd->status.head_top;
@@ -5264,6 +5266,9 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 		case SC_WEDDING:
 		case SC_WEDDING:
 			sc->option |= OPTION_WEDDING;
 			sc->option |= OPTION_WEDDING;
 			break;
 			break;
+		case SC_XMAS:
+			sc->option |= OPTION_XMAS;
+			break;
 		case SC_ORCISH:
 		case SC_ORCISH:
 			sc->option |= OPTION_ORCISH;
 			sc->option |= OPTION_ORCISH;
 			break;
 			break;
@@ -5661,6 +5666,9 @@ int status_change_end( struct block_list* bl , int type,int tid )
 	case SC_WEDDING:	
 	case SC_WEDDING:	
 		sc->option &= ~OPTION_WEDDING;
 		sc->option &= ~OPTION_WEDDING;
 		break;
 		break;
+	case SC_XMAS:	
+		sc->option &= ~OPTION_XMAS;
+		break;
 	case SC_ORCISH:
 	case SC_ORCISH:
 		sc->option &= ~OPTION_ORCISH;
 		sc->option &= ~OPTION_ORCISH;
 		break;
 		break;

+ 18 - 17
src/map/status.h

@@ -455,24 +455,25 @@ enum {
 #define OPT3_AURASHIELD 0x800 //Assumptio
 #define OPT3_AURASHIELD 0x800 //Assumptio
 #define OPT3_HEAT 0x1000 //Warmth Skills
 #define OPT3_HEAT 0x1000 //Warmth Skills
 
 
-#define OPTION_SIGHT 0x0001
-#define OPTION_HIDE 0x0002
-#define OPTION_CLOAK 0x0004
-#define OPTION_CART1 0x0008
-#define OPTION_FALCON 0x0010
-#define OPTION_RIDING 0x0020
-#define OPTION_INVISIBLE 0x0040
-#define OPTION_CART2 0x0080
-#define OPTION_CART3 0x0100
-#define OPTION_CART4 0x0200
-#define OPTION_CART5 0x0400
-#define OPTION_ORCISH 0x0800
-#define OPTION_WEDDING 0x1000
-#define OPTION_RUWACH 0x2000
-#define OPTION_CHASEWALK 0x4000
-#define OPTION_FLYING 0x8000
+#define OPTION_SIGHT 0x00000001
+#define OPTION_HIDE 0x00000002
+#define OPTION_CLOAK 0x00000004
+#define OPTION_CART1 0x00000008
+#define OPTION_FALCON 0x00000010
+#define OPTION_RIDING 0x00000020
+#define OPTION_INVISIBLE 0x00000040
+#define OPTION_CART2 0x00000080
+#define OPTION_CART3 0x00000100
+#define OPTION_CART4 0x00000200
+#define OPTION_CART5 0x00000400
+#define OPTION_ORCISH 0x00000800
+#define OPTION_WEDDING 0x00001000
+#define OPTION_RUWACH 0x00002000
+#define OPTION_CHASEWALK 0x00004000
+#define OPTION_FLYING 0x00008000
 //TODO: Get these Missing options...
 //TODO: Get these Missing options...
-#define OPTION_SIGHTTRASHER 0x0001
+#define OPTION_SIGHTTRASHER 0x00010000
+#define OPTION_XMAS 0x0020000
 
 
 #define OPTION_CART (OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5)
 #define OPTION_CART (OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5)