summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-21 01:26:05 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-21 01:26:05 +0000
commit1dea49c7f44dc9c33f8d204809a830be58a75ba2 (patch)
treeac3c326f5e1895b57e0f4cd9bde19b41067570f5 /src/map
parent264305efdb1f95c18c9f479fc386342dac313f43 (diff)
downloadhercules-1dea49c7f44dc9c33f8d204809a830be58a75ba2.tar.gz
hercules-1dea49c7f44dc9c33f8d204809a830be58a75ba2.tar.bz2
hercules-1dea49c7f44dc9c33f8d204809a830be58a75ba2.tar.xz
hercules-1dea49c7f44dc9c33f8d204809a830be58a75ba2.zip
Fixed bugreport:5968 mvp tombs should now unload w/o spiking cpu / lag / whatever.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16460 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 1dacdd5ab..6b0e8ace2 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -172,8 +172,26 @@ void mvptomb_destroy(struct mob_data *md)
{
struct npc_data *nd = md->tomb_npc;
- if (nd)
- npc_unload(nd,true);
+ if (nd) {
+ int m, i;
+
+ m = nd->bl.m;
+
+ 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);
+ }
md->tomb_npc = NULL;
}