drop_agents(): Do not drop agents that are dead, but still with a connection

This commit is contained in:
Petr Baudis 2011-11-29 20:02:38 +01:00
parent 12724c016d
commit 6c20afd21c

View file

@ -29,7 +29,7 @@ drop_agents(void)
for (std::list<class agent *>::iterator agent = agents.begin(); agent != agents.end(); agent++)
{
next_agent:
if (((*agent)->conn && (*agent)->conn->error) || (*agent)->dead) {
if ((*agent)->conn ? (*agent)->conn->error : (*agent)->dead) {
delete *agent;
agent = agents.erase(agent);
if (agent != agents.end())