From 870273e48f306d7af76dce976ec756bb3c8a409d Mon Sep 17 00:00:00 2001 From: Playtester Date: Mon, 9 Jan 2017 20:36:30 +0100 Subject: [PATCH] Fixed Taekwon Mission not working (fixes #1862) * Taekwon Mission will now work regardless of setting "taekwon_mission_mobname" Special thanks to @vstumpf for the fix. --- src/map/mob.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/map/mob.c b/src/map/mob.c index af8bf27c9f..ae544719c2 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2866,14 +2866,14 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) } } - if( sd ) { - struct mob_data *mission_md = map_id2md(sd->mission_mobid); + if (sd) { + struct mob_db *mission_mdb = mobdb_exists(sd->mission_mobid); - if( sd->mission_mobid == md->mob_id || - ( battle_config.taekwon_mission_mobname == 1 && status_get_race2(&md->bl) == RC2_GOBLIN && status_get_race2(&mission_md->bl) == RC2_GOBLIN && mission_md ) || - ( battle_config.taekwon_mission_mobname == 2 && mob_is_samename(md, sd->mission_mobid) ) ) + if ((sd->mission_mobid == md->mob_id) || + (battle_config.taekwon_mission_mobname == 1 && mission_mdb && status_get_race2(&md->bl) == RC2_GOBLIN && mission_mdb->race2 == RC2_GOBLIN) || + (battle_config.taekwon_mission_mobname == 2 && mob_is_samename(md, sd->mission_mobid))) { //TK_MISSION [Skotlex] - if( ++sd->mission_count >= 100 && (temp = mob_get_random_id(MOBG_Branch_Of_Dead_Tree, 0xE, sd->status.base_level)) ) + if (++(sd->mission_count) >= 100 && (temp = mob_get_random_id(MOBG_Branch_Of_Dead_Tree, 0xE, sd->status.base_level))) { pc_addfame(sd, battle_config.fame_taekwon_mission); sd->mission_mobid = temp; @@ -2884,12 +2884,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) pc_setglobalreg(sd, add_str("TK_MISSION_COUNT"), sd->mission_count); } - if( sd->status.party_id ) - map_foreachinrange(quest_update_objective_sub,&md->bl,AREA_SIZE,BL_PC,sd->status.party_id,md->mob_id); - else if( sd->avail_quests ) + if (sd->status.party_id) + map_foreachinrange(quest_update_objective_sub, &md->bl, AREA_SIZE, BL_PC, sd->status.party_id, md->mob_id); + else if (sd->avail_quests) quest_update_objective(sd, md->mob_id); - if( sd->md && src && src->type == BL_MER && mob_db(md->mob_id)->lv > sd->status.base_level/2 ) + if (sd->md && src && src->type == BL_MER && mob_db(md->mob_id)->lv > sd->status.base_level / 2) mercenary_kills(sd->md); }