summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 23:30:48 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 23:30:48 +0000
commited23cac0a89a552f82225dc5c8c702850892a46d (patch)
tree4b2037ab946350d4e5b803c307b8e6f39693e1a6 /src/char
parentb6b59bf78e91dbbef2c52682bef631be019964e3 (diff)
downloadhercules-ed23cac0a89a552f82225dc5c8c702850892a46d.tar.gz
hercules-ed23cac0a89a552f82225dc5c8c702850892a46d.tar.bz2
hercules-ed23cac0a89a552f82225dc5c8c702850892a46d.tar.xz
hercules-ed23cac0a89a552f82225dc5c8c702850892a46d.zip
- Applied multiple fixes which should take care of making homun save/load work on TXT now.
- Added Gatling Fever's batk bonus. - Some cleaning in status_damage which should prevent trying to free already free'd pointers when unit_remove_map invokes unit_free (when status_damage was going to invoke unit_free anyway) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8308 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char')
-rw-r--r--src/char/int_homun.c18
-rw-r--r--src/char/inter.c11
2 files changed, 17 insertions, 12 deletions
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 35b54c2fe..d9153a9fe 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -92,13 +92,13 @@ int inter_homun_fromstr(char *str,struct s_homunculus *p)
p->luk = tmp_int[17];
//Read skills.
- while(str[next]) {
+ while(str[next] && str[next] != '\n') {
if (sscanf(str+next, "%d,%d,%n", &tmp_int[0], &tmp_int[1], &len) != 2)
return 2;
- if (tmp_int[0] >= HM_SKILLBASE && tmp_int[0] < HM_SKILLBASE+MAX_HOMUNSKILL)
+ if (tmp_int[0] > HM_SKILLBASE && tmp_int[0] <= HM_SKILLBASE+MAX_HOMUNSKILL)
{
- i = tmp_int[0] - HM_SKILLBASE;
+ i = tmp_int[0] - HM_SKILLBASE -1;
p->hskill[i].id = tmp_int[0];
p->hskill[i].lv = tmp_int[1];
} else
@@ -327,7 +327,7 @@ int mapif_save_homun(int fd,int account_id,struct s_homunculus *data)
hom_id = data->hom_id;
p= idb_ensure(homun_db,hom_id,create_homun);
memcpy(p,data,sizeof(struct s_homunculus));
- mapif_save_homun_ack(fd,account_id,0);
+ mapif_save_homun_ack(fd,account_id,1);
return 0;
}
@@ -382,11 +382,11 @@ int inter_homun_parse_frommap(int fd)
{
RFIFOHEAD(fd);
switch(RFIFOW(fd,0)){
- case 0x3080: mapif_create_homun(fd); break;
- case 0x3081: mapif_load_homun(fd); break;
- case 0x3082: mapif_parse_SaveHomun(fd); break;
- case 0x3083: mapif_parse_DeleteHomun(fd); break;
- case 0x3084: mapif_parse_RenameHomun(fd); break;
+ case 0x3090: mapif_create_homun(fd); break;
+ case 0x3091: mapif_load_homun(fd); break;
+ case 0x3092: mapif_parse_SaveHomun(fd); break;
+ case 0x3093: mapif_parse_DeleteHomun(fd); break;
+ case 0x3094: mapif_parse_RenameHomun(fd); break;
default:
return 0;
}
diff --git a/src/char/inter.c b/src/char/inter.c
index db12cf3e7..416ab308c 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -39,8 +39,9 @@ struct accreg {
unsigned int party_share_level = 10;
-// 送信パケット長リスト
-int inter_send_packet_length[] = {
+// sending packet list
+// NOTE: This variable ain't used at all! And it's confusing.. where do I add that the length of packet 0x2b07 is 10? x.x [Skotlex]
+int inter_send_packet_length[]={
-1,-1,27,-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3000-0x300f
-1, 7, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0,
35,-1,11,15, 34,29, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -52,7 +53,7 @@ int inter_send_packet_length[] = {
11,-1, 7, 3, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
// recv. packet list
-int inter_recv_packet_length[] = {
+int inter_recv_packet_length[]={
-1,-1, 7,-1, -1,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3000-0x300f
6,-1, 0, 0, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, //0x3010-0x301f
-1, 6,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, //0x3020-0x302f
@@ -62,6 +63,7 @@ int inter_recv_packet_length[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
48,14,-1, 6, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3080-0x308f
+ 68,10,-1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x3090 - 0x309f Homunculus packets [albator]
};
struct WisData {
@@ -251,6 +253,7 @@ int inter_save(void) {
inter_storage_save();
inter_guild_storage_save();
inter_pet_save();
+ inter_homun_save();
inter_accreg_save();
return 0;
@@ -632,6 +635,8 @@ int inter_parse_frommap(int fd) {
break;
if (inter_pet_parse_frommap(fd))
break;
+ if (inter_homun_parse_frommap(fd))
+ break;
return 0;
}
RFIFOSKIP(fd, len);