summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-04-16 20:15:20 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-04-16 20:15:20 +0000
commit432ec6db58f1c10a4c1050d5af6ebe329c03cf91 (patch)
tree3eb41aeb402cda096bcf61190dd02d501482837e /src/char/char.c
parent15a067108a3cf465a4eaddd655770e96ff5c5092 (diff)
downloadhercules-432ec6db58f1c10a4c1050d5af6ebe329c03cf91.tar.gz
hercules-432ec6db58f1c10a4c1050d5af6ebe329c03cf91.tar.bz2
hercules-432ec6db58f1c10a4c1050d5af6ebe329c03cf91.tar.xz
hercules-432ec6db58f1c10a4c1050d5af6ebe329c03cf91.zip
* Added support for visible garments/robes.
- For SQL apply upgrade_svn14797.sql to upgrade table `char`; for TXT no action is necessary, as it upgrades itself. - This also fixes NPCs not being visible with clients 2011-01-11aRagexeRE+ (bugreport:4865). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14797 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 237e04638..178a20262 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -525,7 +525,7 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg,
"%d\t%d,%d\t%s\t%d,%d,%d\t%u,%u,%d" //Up to Zeny field
"\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d" //Up to Skill Point
"\t%d,%d,%d\t%d,%d,%d,%d" //Up to hom id
- "\t%d,%d,%d\t%d,%d,%d,%d,%d" //Up to head bottom
+ "\t%d,%d,%d\t%d,%d,%d,%d,%d,%d" //Up to robe
"\t%d,%d,%d\t%d,%d,%d" //last point + save point
",%d,%d,%d,%d,%d,%lu\t", //Family info + delete date
p->char_id, p->account_id, p->slot, p->name, //
@@ -537,7 +537,7 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg,
p->option, p->karma, p->manner, //
p->party_id, p->guild_id, p->pet_id, p->hom_id,
p->hair, p->hair_color, p->clothes_color,
- p->weapon, p->shield, p->head_top, p->head_mid, p->head_bottom,
+ p->weapon, p->shield, p->head_top, p->head_mid, p->head_bottom, p->robe,
p->last_point.map, p->last_point.x, p->last_point.y, //
p->save_point.map, p->save_point.x, p->save_point.y,
p->partner_id,p->father,p->mother,p->child,p->fame, //
@@ -599,7 +599,26 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
// initilialise character
memset(p, '\0', sizeof(struct mmo_charstatus));
-// Char structure of version 146xx (delete date)
+// Char structure of version 14797 (robe)
+ if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
+ "\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d,%d"
+ "\t%d,%d,%d\t%d,%d,%d,%d,%d,%d,%d,%d,%lu%n",
+ &tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0],
+ &tmp_int[3], &tmp_int[4], &tmp_int[5],
+ &tmp_uint[0], &tmp_uint[1], &tmp_int[8],
+ &tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
+ &tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
+ &tmp_int[19], &tmp_int[20],
+ &tmp_int[21], &tmp_int[22], &tmp_int[23], //
+ &tmp_int[24], &tmp_int[25], &tmp_int[26], &tmp_int[44],
+ &tmp_int[27], &tmp_int[28], &tmp_int[29],
+ &tmp_int[30], &tmp_int[31], &tmp_int[32], &tmp_int[33], &tmp_int[34], &tmp_int[47],
+ &tmp_int[45], &tmp_int[35], &tmp_int[36],
+ &tmp_int[46], &tmp_int[37], &tmp_int[38], &tmp_int[39],
+ &tmp_int[40], &tmp_int[41], &tmp_int[42], &tmp_int[43], &tmp_ulong[0], &next) != 50)
+ {
+ tmp_int[47] = 0; // robe
+// Char structure of version 14700 (delete date)
if (sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
"\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
"\t%d,%d,%d\t%d,%d,%d,%d,%d,%d,%d,%d,%lu%n",
@@ -742,7 +761,8 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
tmp_int[45] = mapindex_name2id(tmp_str[1]);
tmp_int[46] = mapindex_name2id(tmp_str[2]);
} // Char structure of version 1500 (homun + mapindex maps)
- } // Char structure of version 146xx (delete date)
+ } // Char structure of version 14700 (delete date)
+ } // Char structure of version 14797 (robe)
safestrncpy(p->name, tmp_str[0], NAME_LENGTH); //Overflow protection [Skotlex]
p->char_id = tmp_int[0];
@@ -793,6 +813,7 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
p->last_point.map = tmp_int[45];
p->save_point.map = tmp_int[46];
p->delete_date = tmp_ulong[0];
+ p->robe = tmp_int[47];
#ifndef TXT_SQL_CONVERT
// Some checks
@@ -1837,7 +1858,7 @@ int mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p)
offset += 4;
#endif
#if PACKETVER >= 20110111
- WBUFL(buf,128) = 0; // robe sprite id
+ WBUFL(buf,128) = p->robe;
offset += 4;
#endif
return 106+offset;