diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-11-12 23:04:51 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-11-12 23:04:51 +1300 |
commit | 3fd3bf1fd21109043adb096cf08c76a31466c481 (patch) | |
tree | 14ae8fb8ed8cb67311f6fb6687adefe2f633c6ca | |
parent | Simplify Makefile a lot (diff) | |
download | texad-3fd3bf1fd21109043adb096cf08c76a31466c481.tar.gz texad-3fd3bf1fd21109043adb096cf08c76a31466c481.zip |
Rephrase a loop
-rw-r--r-- | texad.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; |