From 0cf52e88ea2779d00c64e36b33e606d658682136 Mon Sep 17 00:00:00 2001 From: Haru Date: Fri, 29 Nov 2013 00:51:32 +0100 Subject: Corrected an uninitialized variable when adding an item - The .favorite field of newly added inventory items wasn't correctly initialized to zero, potentially causing data loss (fixes bugreport:7854, thanks to Vincent, GrumpyPanda). Signed-off-by: Haru --- src/char/char.c | 1 + src/map/mob.c | 2 +- src/map/pc.c | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/char/char.c b/src/char/char.c index 63b47cfcf..e58fc9eef 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1278,6 +1278,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything StrBuf->Printf(&buf, ", `card%d`", j); StrBuf->Printf(&buf, " FROM `%s` WHERE `char_id`=? LIMIT %d", cart_db, MAX_CART); + memset(&tmp_item, 0, sizeof(tmp_item)); if( SQL_ERROR == SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf)) || SQL_ERROR == SQL->StmtBindParam(stmt, 0, SQLDT_INT, &char_id, 0) || SQL_ERROR == SQL->StmtExecute(stmt) diff --git a/src/map/mob.c b/src/map/mob.c index 777518d87..1e197756e 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2448,7 +2448,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { if(mvp_sd && md->db->mexp > 0 && !md->special_state.ai) { int log_mvp[2] = {0}; unsigned int mexp; - struct item item; double exp; //mapflag: noexp check [Lorky] @@ -2471,6 +2470,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { /* pose them randomly in the list -- so on 100% drop servers it wont always drop the same item */ int mdrop_id[MAX_MVP_DROP]; int mdrop_p[MAX_MVP_DROP]; + struct item item; memset(&mdrop_id,0,MAX_MVP_DROP*sizeof(int)); diff --git a/src/map/pc.c b/src/map/pc.c index b5fa9268e..6120ba033 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3997,9 +3997,11 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l return 4; memcpy(&sd->status.inventory[i], item_data, sizeof(sd->status.inventory[0])); - // clear equips field first, just in case + // clear equip and favorite fields first, just in case if( item_data->equip ) sd->status.inventory[i].equip = 0; + if( item_data->favorite ) + sd->status.inventory[i].favorite = 0; sd->status.inventory[i].amount = amount; sd->inventory_data[i] = data; -- cgit v1.2.3-60-g2f50 From 19758ee2206dd4d1183028e9f25c2b86f6716b73 Mon Sep 17 00:00:00 2001 From: malufett Date: Fri, 29 Nov 2013 11:11:17 +0800 Subject: Update JOB_REBELLION 'job_db1.txt' to its official values and some mini adjustment. Signed-off-by: malufett --- conf/battle/battle.conf | 1 + conf/messages.conf | 4 ++-- db/re/job_db1.txt | 5 +++-- src/char/inter.c | 5 ++++- src/map/pc.c | 5 +++-- 5 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf index 70062a16e..5b72f5ff9 100644 --- a/conf/battle/battle.conf +++ b/conf/battle/battle.conf @@ -54,6 +54,7 @@ player_damage_delay_rate: 100 undead_detect_type: 0 // Does HP recover if hit by an attribute that's same as your own? (Note 1) +// (Will not work in Renewal) attribute_recover: no // What is the minimum and maximum hitrate of normal attacks? diff --git a/conf/messages.conf b/conf/messages.conf index aae0596af..ba63dc73a 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -621,7 +621,8 @@ 652: Expanded Super Baby 653: Kagerou 654: Oboro -655: Unknown Job +655: Rebellion +656: Unknown Job // MvP Tomb // Added here so it can be easily translated @@ -667,7 +668,6 @@ 691: Sura T 692: Genetic T 693: Shadow Chaser T -694: Rebellion //------------------------------------ diff --git a/db/re/job_db1.txt b/db/re/job_db1.txt index ff175592a..abc9d2bb8 100644 --- a/db/re/job_db1.txt +++ b/db/re/job_db1.txt @@ -52,7 +52,7 @@ // Super Novice 23, 20000,0 ,500 ,100 ,440 ,590 ,610 ,2000 ,2000 ,2000 ,540 ,2000 ,540 ,540 ,690 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,690 ,540 // Gunslinger -24, 28000,88 ,0 ,450 ,540 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490 ,590 ,440 ,940 ,1040 ,2000 ,2000 ,600 +24, 28000,88 ,0 ,450 ,540 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490 ,590 ,540 ,940 ,1040 ,2000 ,2000 ,600 // Ninja 25, 26000,80 ,0 ,515 ,440 ,470 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,590 ,2000 ,500 // Novice High @@ -270,4 +270,5 @@ // Oboro 4212, 26000,80 , 0 ,515 ,400 ,500 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 , 750 ,2000 ,500 // Rebellion -4215, 28000,88 , 0 ,450 ,540 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490 ,590 ,440 ,940 ,1040 ,2000 ,2000 ,600 + +4215, 28000,88 , 0 ,450 ,550 ,2000, 2000, 2000, 2000, 2000, 2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 , 520 , 620 , 570 ,970 ,1070 ,2000 ,2000 ,600 diff --git a/src/char/inter.c b/src/char/inter.c index b213f1608..771b51602 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -341,8 +341,11 @@ const char* job_name(int class_) { case JOB_OBORO: return msg_txt(653 - JOB_KAGEROU+class_); - default: + case JOB_REBELLION: return msg_txt(655); + + default: + return msg_txt(656); } } diff --git a/src/map/pc.c b/src/map/pc.c index 6120ba033..57433ea0d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5759,11 +5759,12 @@ const char* job_name(int class_) case JOB_KAGEROU: case JOB_OBORO: return msg_txt(653 - JOB_KAGEROU+class_); + case JOB_REBELLION: - return msg_txt(694); + return msg_txt(655); default: - return msg_txt(655); + return msg_txt(656); } } -- cgit v1.2.3-60-g2f50