mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 22:01:30 +00:00
Tired of this GLM warning (and we dont even use glm rotate grr) also reworked how I approached that peq entity process crash after thinking about it a bit
This commit is contained in:
parent
aa021addc1
commit
c57292a9dd
@ -289,6 +289,7 @@ ADD_DEFINITIONS(-DLOG_LEVEL_DEBUG=${EQEMU_LOG_LEVEL_DEBUG})
|
|||||||
ADD_DEFINITIONS(-DLOG_LEVEL_QUEST=${EQEMU_LOG_LEVEL_QUEST})
|
ADD_DEFINITIONS(-DLOG_LEVEL_QUEST=${EQEMU_LOG_LEVEL_QUEST})
|
||||||
ADD_DEFINITIONS(-DLOG_LEVEL_COMMANDS=${EQEMU_LOG_LEVEL_COMMANDS})
|
ADD_DEFINITIONS(-DLOG_LEVEL_COMMANDS=${EQEMU_LOG_LEVEL_COMMANDS})
|
||||||
ADD_DEFINITIONS(-DLOG_LEVEL_CRASH=${EQEMU_LOG_LEVEL_CRASH})
|
ADD_DEFINITIONS(-DLOG_LEVEL_CRASH=${EQEMU_LOG_LEVEL_CRASH})
|
||||||
|
ADD_DEFINITIONS(-DGLM_FORCE_RADIANS)
|
||||||
|
|
||||||
IF(EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS)
|
IF(EQEMU_STREAM_RETRANSMIT_ACKED_PACKETS)
|
||||||
ADD_DEFINITIONS(-DRETRANSMIT_ACKED_PACKETS=true)
|
ADD_DEFINITIONS(-DRETRANSMIT_ACKED_PACKETS=true)
|
||||||
|
|||||||
@ -490,22 +490,36 @@ void EntityList::MobProcess()
|
|||||||
#endif
|
#endif
|
||||||
auto it = mob_list.begin();
|
auto it = mob_list.begin();
|
||||||
while (it != mob_list.end()) {
|
while (it != mob_list.end()) {
|
||||||
if (!it->second) {
|
uint16 id = it->first;
|
||||||
|
Mob *mob = it->second;
|
||||||
|
|
||||||
|
size_t sz = mob_list.size();
|
||||||
|
bool p_val = mob->Process();
|
||||||
|
size_t a_sz = mob_list.size();
|
||||||
|
|
||||||
|
if(a_sz > sz) {
|
||||||
|
//increased size can potentially screw with iterators so reset it to current value
|
||||||
|
//if buckets are re-orderered we may skip a process here and there but since
|
||||||
|
//process happens so often it shouldn't matter much
|
||||||
|
it = mob_list.find(id);
|
||||||
|
++it;
|
||||||
|
} else {
|
||||||
++it;
|
++it;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (!it->second->Process()) {
|
|
||||||
Mob *mob = it->second;
|
if(!p_val) {
|
||||||
uint16 tempid = it->first;
|
if(mob->IsNPC()) {
|
||||||
if (mob->IsNPC()) {
|
entity_list.RemoveNPC(id);
|
||||||
entity_list.RemoveNPC(mob->CastToNPC()->GetID());
|
}
|
||||||
} else if (mob->IsMerc()) {
|
else if(mob->IsMerc()) {
|
||||||
entity_list.RemoveMerc(mob->CastToMerc()->GetID());
|
entity_list.RemoveMerc(id);
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
} else if (mob->IsBot()) {
|
}
|
||||||
entity_list.RemoveBot(mob->CastToBot()->GetID());
|
else if(mob->IsBot()) {
|
||||||
|
entity_list.RemoveBot(id);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = mob->CastToClient()->GetIP();
|
in.s_addr = mob->CastToClient()->GetIP();
|
||||||
@ -513,25 +527,19 @@ void EntityList::MobProcess()
|
|||||||
#endif
|
#endif
|
||||||
zone->StartShutdownTimer();
|
zone->StartShutdownTimer();
|
||||||
Group *g = GetGroupByMob(mob);
|
Group *g = GetGroupByMob(mob);
|
||||||
if (g) {
|
if(g) {
|
||||||
LogFile->write(EQEMuLog::Error, "About to delete a client still in a group.");
|
LogFile->write(EQEMuLog::Error, "About to delete a client still in a group.");
|
||||||
g->DelMember(mob);
|
g->DelMember(mob);
|
||||||
}
|
}
|
||||||
Raid *r = entity_list.GetRaidByClient(mob->CastToClient());
|
Raid *r = entity_list.GetRaidByClient(mob->CastToClient());
|
||||||
if (r) {
|
if(r) {
|
||||||
LogFile->write(EQEMuLog::Error, "About to delete a client still in a raid.");
|
LogFile->write(EQEMuLog::Error, "About to delete a client still in a raid.");
|
||||||
r->MemberZoned(mob->CastToClient());
|
r->MemberZoned(mob->CastToClient());
|
||||||
}
|
}
|
||||||
entity_list.RemoveClient(mob->GetID());
|
entity_list.RemoveClient(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity_list.RemoveMob(tempid)) {
|
entity_list.RemoveMob(id);
|
||||||
it = mob_list.begin();
|
|
||||||
} else {
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
++it;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user