mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Fix issue with mobs no depopping (due to spawn_events) while zone is idle.
This commit is contained in:
parent
ec36a3787d
commit
f3120f26ee
@ -468,17 +468,27 @@ void EntityList::CorpseProcess()
|
|||||||
|
|
||||||
void EntityList::MobProcess()
|
void EntityList::MobProcess()
|
||||||
{
|
{
|
||||||
#ifdef IDLE_WHEN_EMPTY
|
bool mob_dead;
|
||||||
if (numclients < 1)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
auto it = mob_list.begin();
|
auto it = mob_list.begin();
|
||||||
while (it != mob_list.end()) {
|
while (it != mob_list.end()) {
|
||||||
uint16 id = it->first;
|
uint16 id = it->first;
|
||||||
Mob *mob = it->second;
|
Mob *mob = it->second;
|
||||||
|
|
||||||
size_t sz = mob_list.size();
|
size_t sz = mob_list.size();
|
||||||
bool p_val = mob->Process();
|
|
||||||
|
#ifdef IDLE_WHEN_EMPTY
|
||||||
|
// spawn_events can cause spawns and deaths while zone empty.
|
||||||
|
// At the very least, process that.
|
||||||
|
if (numclients < 1) {
|
||||||
|
mob_dead = mob->CastToNPC()->GetDepop();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mob_dead = !mob->Process();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
mob_dead = !mob->Process();
|
||||||
|
#endif
|
||||||
size_t a_sz = mob_list.size();
|
size_t a_sz = mob_list.size();
|
||||||
|
|
||||||
if(a_sz > sz) {
|
if(a_sz > sz) {
|
||||||
@ -491,7 +501,7 @@ void EntityList::MobProcess()
|
|||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!p_val) {
|
if(mob_dead) {
|
||||||
if(mob->IsNPC()) {
|
if(mob->IsNPC()) {
|
||||||
entity_list.RemoveNPC(id);
|
entity_list.RemoveNPC(id);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user