Fixed bugreport:5968 mvp tombs should now unload w/o spiking cpu / lag / whatever.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16460 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
c54c4e1e34
commit
62338c3fd1
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user