mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 09:53:38 +02:00
Preserve corpses of disconnected agents
This commit is contained in:
parent
fb3a8b64b2
commit
9c4adb5a3a
2 changed files with 10 additions and 2 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)->tile) {
|
||||
delete *agent;
|
||||
agent = agents.erase(agent);
|
||||
if (agent != agents.end())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue