diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/chat.c | 1 | ||||
-rw-r--r-- | src/map/map.c | 11 | ||||
-rw-r--r-- | src/map/skill.c | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/map/chat.c b/src/map/chat.c index a761d528a..d68864fe1 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -328,6 +328,7 @@ int chat_deletenpcchat(struct npc_data* nd) clif_clearchat(cd, 0); map_delblock(&cd->bl); map_freeblock(&cd->bl); + map_deliddb(&cd->bl); nd->chat_id = 0; return 0; diff --git a/src/map/map.c b/src/map/map.c index 372647088..7dfd56488 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1171,18 +1171,23 @@ int map_get_new_object_id(void) *------------------------------------------*/ int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr data) { - struct flooritem_data* fitem = idb_get(id_db, id); - if(fitem==NULL || fitem->bl.type!=BL_ITEM || (!data && fitem->cleartimer != tid)){ + struct flooritem_data* fitem = (struct flooritem_data*)idb_get(id_db, id); + if( fitem==NULL || fitem->bl.type!=BL_ITEM || (!data && fitem->cleartimer != tid) ) + { ShowError("map_clearflooritem_timer : error\n"); return 1; } + if(data) delete_timer(fitem->cleartimer,map_clearflooritem_timer); - else if(fitem->item_data.card[0] == CARD0_PET) + else + if(fitem->item_data.card[0] == CARD0_PET) // pet egg intif_delete_petdata( MakeDWord(fitem->item_data.card[1],fitem->item_data.card[2]) ); + clif_clearflooritem(fitem,0); map_delblock(&fitem->bl); map_freeblock(&fitem->bl); + map_deliddb(&fitem->bl); return 0; } diff --git a/src/map/skill.c b/src/map/skill.c index c7bd3f998..9d03be3d9 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -9587,8 +9587,9 @@ int skill_delunit (struct skill_unit* unit) unit->group=NULL; unit->alive=0; - idb_remove(skillunit_db, unit->bl.id); map_delblock(&unit->bl); // don't free yet + map_deliddb(&unit->bl); + idb_remove(skillunit_db, unit->bl.id); if(--group->alive_count==0) skill_delunitgroup(NULL, group); @@ -11404,6 +11405,7 @@ int do_final_skill(void) { db_destroy(skilldb_name2id); db_destroy(group_db); + db_destroy(skillunit_db); ers_destroy(skill_unit_ers); ers_destroy(skill_timer_ers); return 0; |