Preserve corpses of disconnected agents

This commit is contained in:
Petr Baudis 2011-11-29 22:58:18 +01:00
parent fb3a8b64b2
commit 9c4adb5a3a
2 changed files with 10 additions and 2 deletions

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)->tile) {
delete *agent;
agent = agents.erase(agent);
if (agent != agents.end())