summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-12 23:04:51 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-12 23:04:51 +1300
commit3fd3bf1fd21109043adb096cf08c76a31466c481 (patch)
tree14ae8fb8ed8cb67311f6fb6687adefe2f633c6ca
parentSimplify Makefile a lot (diff)
downloadtexad-3fd3bf1fd21109043adb096cf08c76a31466c481.tar.gz
texad-3fd3bf1fd21109043adb096cf08c76a31466c481.zip
Rephrase a loop
-rw-r--r--texad.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/texad.c b/texad.c
index 1fbf733..d44e10e 100644
--- a/texad.c
+++ b/texad.c
@@ -152,11 +152,11 @@ void move(struct player *p, enum direction dir)
{
struct door **ds;
for (ds = p->room->doors; *ds; ds++) {
- if ((*ds)->direction == dir) {
- p->room = (*ds)->dst;
- look(p->room);
- return;
- }
+ if ((*ds)->direction != dir)
+ continue;
+ p->room = (*ds)->dst;
+ look(p->room);
+ return;
}
puts("You can't go that way.");
return;