From a51a145ba86fb227e398caab95baf54c59293ec0 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 6 Dec 2017 20:06:46 +0100 Subject: [PATCH] make this loop a little more readable. warning: the break has no tests. --- src/steal.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/steal.c b/src/steal.c index 13df2c4ce..250681598 100644 --- a/src/steal.c +++ b/src/steal.c @@ -57,14 +57,21 @@ void expandstealing(region * r, econ_request * stealorders) if (!norders) return; /* F�r jede unit in der Region wird Geld geklaut, wenn sie Opfer eines - * Beklauen-Orders ist. Jedes Opfer mu� einzeln behandelt werden. + * Beklauen-Orders ist. Jedes Opfer muss einzeln behandelt werden. * * u ist die beklaute unit. oa.unit ist die klauende unit. */ - for (j = 0; j != norders && requests[j].unit->n <= requests[j].unit->wants; j++) { - unit *u = findunitg(requests[j].no, r); + for (j = 0; j != norders; j++) { + unit *u; int n = 0; + + if (requests[j].unit->n > requests[j].unit->wants) { + break; + } + + u = findunitg(requests[j].no, r); + if (u && u->region == r) { n = get_pooled(u, rsilver, GET_ALL, INT_MAX); }