diff options
author | sanine <sanine.not@pm.me> | 2023-11-11 23:05:12 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-11 23:05:12 -0600 |
commit | 661847f269030c0cbaa681e2d4697873f891cdec (patch) | |
tree | 8128128b920d37e50f07647ebfd0078db15f43e0 /src/simulation/lattice_rules.js | |
parent | b778ab8b5a547328c044b47c99ec79661283c151 (diff) |
fix team information for empty cells
Diffstat (limited to 'src/simulation/lattice_rules.js')
-rw-r--r-- | src/simulation/lattice_rules.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/simulation/lattice_rules.js b/src/simulation/lattice_rules.js index 80f3221..cc2fc5b 100644 --- a/src/simulation/lattice_rules.js +++ b/src/simulation/lattice_rules.js @@ -1,4 +1,5 @@ import { pairs } from '../util.js'; +import { get_team } from './game.js'; function mod(k, n) { return ((k % n) + n) % n; @@ -34,6 +35,10 @@ export const lattice_rules = { x, y, from: 'empty', to: 'active', flags: { emit: [0, 0, 0, 0, 0, 0, 0, 1] }, }]}; + } else { + return { world_updates: [{ + x, y, flags: { team: get_team(lattice.length, x, y) }, + }]}; } }, |