diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-02 15:01:57 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-02 15:01:57 +1300 |
commit | d370740efa804000238052331a95c17ed2a45481 (patch) | |
tree | 6146b1ea0ca4c049d6615e5ac75c3ac2bdeee4c9 | |
parent | Use arrays rather than number suffixes (diff) | |
download | texad-d370740efa804000238052331a95c17ed2a45481.tar.gz texad-d370740efa804000238052331a95c17ed2a45481.zip |
Move temporary doors structure into static array
-rw-r--r-- | texad.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -108,13 +108,15 @@ struct world *genesis(void) d[3]->src = r[2]; d[3]->dst = r[1]; - struct door *ds1[] = {d[0], NULL}; - struct door *ds2[] = {d[1], d[2], NULL}; - struct door *ds3[] = {d[3], NULL}; - - r[0]->doors = ds1; - r[1]->doors = ds2; - r[2]->doors = ds3; + struct door *ds[3][3] = { + {d[0], NULL, NULL}, + {d[1], d[2], NULL}, + {d[3], NULL, NULL} + }; + + r[0]->doors = ds[0]; + r[1]->doors = ds[1]; + r[2]->doors = ds[2]; p->room = r[0]; |