summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-09-12 17:37:37 +0000
committerdarkvater <darkvater@openttd.org>2004-09-12 17:37:37 +0000
commit1f1f578abbde79f20fc489aa6189848e7e8fcbbb (patch)
tree7c4121708020b92e63277776021b1cf48833378b
parent53ee4f65400c3ca0f968bc2d54482677ad914253 (diff)
downloadopenttd-1f1f578abbde79f20fc489aa6189848e7e8fcbbb.tar.xz
(svn r217) -Fix: remove warning and simplify loop network_gui.c (Tron)
-rw-r--r--network_gui.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/network_gui.c b/network_gui.c
index e80c0b443..fbc6aa6c9 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -119,12 +119,8 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
{
NetworkGameList *cur_item = _network_game_list;
- int32 n = 0;
- while (cur_item != NULL) {
- if (n++ == id_v) { break;} // found clicked item
-
+ for (; id_v > 0 && cur_item != NULL; id_v--)
cur_item = cur_item->_next;
- }
if (cur_item == NULL) { return;} // click out of vehicle bounds