If you spawn 2 or more mobs in the same zone with the same npc_types ID and then call quest::depop(npctypes ID), it will always depop the first mob it finds in the npc list, but it won't depop the 2nd or any other mobs with that ID. Subsequent calls to quest::depop(npctypes ID) will also fail to depop the 2nd or more mobs with that ID.
I have corrected this bug with the code below:
Please replace the questmgr::depop(int) method in the questmgr.cpp file with the method below:
Code:
void QuestManager::depop(int npc_type) {
if (npc_type != 0){
Mob * tmp = entity_list.GetMobByNpcTypeID(npc_type);
if (tmp) {
if(tmp != npc)
{
tmp->CastToNPC()->Depop();
entity_list.RemoveNPC(tmp->GetID());
entity_list.RemoveMob(tmp->GetID());
}
else
depop_npc = true;
}
}
else { //depop self
depop_npc = true;
}
}
This code will allow you to depop any number of mobs with the same ID. Basically, you would cal questmgr::depop(npctypes ID) once for each mob of this type you want to despawn.
Please add this to the server code. I and Sesmar have both tested this and find that it works as expected. Thank you!