summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-02 15:01:57 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-02 15:01:57 +1300
commitd370740efa804000238052331a95c17ed2a45481 (patch)
tree6146b1ea0ca4c049d6615e5ac75c3ac2bdeee4c9
parentUse arrays rather than number suffixes (diff)
downloadtexad-d370740efa804000238052331a95c17ed2a45481.tar.gz
texad-d370740efa804000238052331a95c17ed2a45481.zip
Move temporary doors structure into static array
-rw-r--r--texad.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/texad.c b/texad.c
index eabd59e..53cb3be 100644
--- a/texad.c
+++ b/texad.c
@@ -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];