summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-18 14:43:04 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-18 14:43:04 +0000
commit53e154561caec018e734900a0a4e53cf35e3f2c0 (patch)
tree7a7bc225f826d2b913ae340dddddc6b9b8031d58 /src/map/npc.c
parentef916748dd182bcff937f276df87ccaa9fe3e3d1 (diff)
downloadhercules-53e154561caec018e734900a0a4e53cf35e3f2c0.tar.gz
hercules-53e154561caec018e734900a0a4e53cf35e3f2c0.tar.bz2
hercules-53e154561caec018e734900a0a4e53cf35e3f2c0.tar.xz
hercules-53e154561caec018e734900a0a4e53cf35e3f2c0.zip
- Reloading scripts will no longer eliminate mobs with no respawn data. Watch out for duplicating Treasure Boxes?
- Some cleaning of npc_final - Made speed_add_rate a linearly stacking increase. - Corrected a possible overflow when using show_mob_info to display the mob's up as a percent. - Corrected the documentation for checkoption/checkoption1/checkoption2 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8792 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 8e1cfd336..fc93207a8 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2811,7 +2811,9 @@ static int npc_cleanup_sub (struct block_list *bl, va_list ap) {
npc_unload((struct npc_data *)bl);
break;
case BL_MOB:
- unit_free(bl,0);
+ //This is used only on reloading npcs, so let's not free spawn-once mobs. [Skotlex]
+ if (((TBL_MOB*)bl)->spawn)
+ unit_free(bl,0);
break;
}
@@ -2903,21 +2905,13 @@ int do_final_npc(void)
{
int i;
struct block_list *bl;
- struct npc_data *nd;
- struct mob_data *md;
- struct pet_data *pd;
for (i = START_NPC_NUM; i < npc_id; i++){
if ((bl = map_id2bl(i))){
- if (bl->type == BL_NPC && (nd = (struct npc_data *)bl)){
- npc_unload(nd);
- } else if (bl->type == BL_MOB && (md = (struct mob_data *)bl)){
- if (md->lootitem)
- aFree(md->lootitem);
- aFree(md);
- } else if (bl->type == BL_PET && (pd = (struct pet_data *)bl)){
- aFree(pd);
- }
+ if (bl->type == BL_NPC)
+ npc_unload((struct npc_data *)bl);
+ else if (bl->type&(BL_MOB|BL_PET))
+ unit_free(bl, 0);
}
}