diff --git a/src/map/mob.c b/src/map/mob.c index b37cd768fc..82d6501923 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -168,11 +168,23 @@ void mvptomb_create(struct mob_data *md, char *killer, time_t time) } +/** Destroys MVP Tomb +* @param md +*/ void mvptomb_destroy(struct mob_data *md) { struct npc_data *nd; if ( (nd = map_id2nd(md->tomb_nid)) ) { - npc_remove_map(nd); + int16 m = nd->bl.m, i; + clif_clearunit_area(&nd->bl,CLR_OUTSIGHT); + map_delblock(&nd->bl); + + ARR_FIND( 0, map[m].npc_num, i, map[m].npc[i] == nd ); + if( !(i == map[m].npc_num) ) { + map[m].npc_num--; + map[m].npc[i] = map[m].npc[map[m].npc_num]; + map[m].npc[map[m].npc_num] = NULL; + } map_deliddb(&nd->bl); aFree(nd); } diff --git a/src/map/pc.c b/src/map/pc.c index 9a567f98e3..e6aa8d0708 100755 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1909,7 +1909,7 @@ static int pc_bonus_addeff_onskill(struct s_addeffectonskill* effect, int max, e * @param race: target race. if < 0, means monster_id * @param rate: rate value: 1 ~ 10000. If < 0, it will be multiplied with mob level/10 */ -static void pc_bonus_item_drop(struct s_add_drop *drop, const short max, uint16 nameid, uint16 group, int class_, int race, int rate) +static void pc_bonus_item_drop(struct s_add_drop *drop, const short max, uint16 nameid, uint16 group, int class_, short race, int rate) { uint8 i; if (nameid && !group && !itemdb_exists(nameid)) { @@ -4004,7 +4004,7 @@ int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, *------------------------------------------*/ int pc_search_inventory(struct map_session_data *sd,int item_id) { - int i; + int16 i; nullpo_retr(-1, sd); ARR_FIND( 0, MAX_INVENTORY, i, sd->status.inventory[i].nameid == item_id && (sd->status.inventory[i].amount > 0 || item_id == 0) ); @@ -4028,7 +4028,7 @@ int pc_search_inventory(struct map_session_data *sd,int item_id) */ char pc_additem(struct map_session_data *sd,struct item *item,int amount,e_log_pick_type log_type) { struct item_data *id; - uint16 i; + int16 i; unsigned int w; nullpo_retr(1, sd); diff --git a/src/map/pc.h b/src/map/pc.h index f49918cdb3..463d6cafec 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -117,8 +117,8 @@ struct s_add_drop { uint16 nameid, ///Item ID group; ///Group ID int rate; ///Rate, 1 ~ 10000, -1 ~ -100000 - char race, ///Target Race, bitwise value of 1<