mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 09:53:38 +02:00
Connection: Add 'move' attribute to the negotiation phase
This commit is contained in:
parent
9cf99e0bcd
commit
2907cb6791
4 changed files with 25 additions and 1 deletions
3
agent.cc
3
agent.cc
|
@ -29,6 +29,9 @@ agent::move_dir(int dir_x, int dir_y)
|
|||
if (dead || !tile)
|
||||
return false;
|
||||
|
||||
if ((double) random() / (double) RAND_MAX > attr.move)
|
||||
return false;
|
||||
|
||||
chenergy(world::move_cost);
|
||||
|
||||
class tile *t2 = &tile->tile_in_dir(dir_x, dir_y);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue