From bd5aa5f04b6713f7d3763834d4e073100d2fde40 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 14 Dec 2004 00:23:19 +0000 Subject: [PATCH] endless loop --- src/common/gamecode/spy.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/common/gamecode/spy.c b/src/common/gamecode/spy.c index 54a591e41..3bf218d41 100644 --- a/src/common/gamecode/spy.c +++ b/src/common/gamecode/spy.c @@ -235,17 +235,18 @@ setstealth_cmd(unit * u, struct order * ord) unit * mu = u->faction->units; while (mu!=NULL) { unit * ru = mu->region->units; - if (mu->region==lastr) continue; - while (ru!=NULL) { - attrib *a = a_find(ru->attribs, &at_otherfaction); - if (a) { - faction *fv = get_otherfaction(a); - if (fv==f) break; + if (mu->region!=lastr) { + while (ru!=NULL) { + attrib *a = a_find(ru->attribs, &at_otherfaction); + if (a) { + faction *fv = get_otherfaction(a); + if (fv==f) break; + } + ru = ru->next; } - ru = ru->next; + if (ru!=NULL) break; + lastr = mu->region; } - if (ru!=NULL) break; - lastr = mu->region; mu = mu->nextF; } if (mu!=NULL) {