mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +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
10
agent.cc
10
agent.cc
|
@ -110,6 +110,13 @@ agent::on_action_takes(void)
|
|||
if (!conn)
|
||||
return;
|
||||
|
||||
if (conn->error) {
|
||||
die();
|
||||
conn->cancel();
|
||||
conn = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
conn->actions(*this);
|
||||
}
|
||||
|
||||
|
@ -176,6 +183,7 @@ herb::on_tick(void)
|
|||
spawn_herb(tile->tile_in_dir(0, 1));
|
||||
spawn_herb(tile->tile_in_dir(-1, 0));
|
||||
spawn_herb(tile->tile_in_dir(0, -1));
|
||||
die();
|
||||
tile->on_agent_leave(*this);
|
||||
tile = NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue