mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
drop_agents(): Do not drop agents that are dead, but still with a connection
This commit is contained in:
parent
12724c016d
commit
6c20afd21c
1 changed files with 1 additions and 1 deletions
2
main.cc
2
main.cc
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue