agent::spawn_at(): Disassociate from constructor, allow tile == NULL

This commit is contained in:
Petr Baudis 2011-11-27 04:28:16 +01:00
parent 3e5366a5c4
commit 7714906baa
3 changed files with 13 additions and 13 deletions

View file

@ -67,7 +67,9 @@ next_agent:
int cfd = accept(lfd, NULL, NULL);
if (cfd >= 0) {
class connection *conn = new class connection(cfd);
agents.push_back(new class agent(aid++, map.agent_startpos(), conn));
class agent *a = new class agent(aid++, conn);
agents.push_back(a);
a->spawn_at(map.agent_startpos());
}
/* Collect and take actions. */