]> git.pond.sub.org Git - empserver/commitdiff
update: Fix unowned uw to eat, procreate and produce
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 5 Jun 2016 12:37:41 +0000 (14:37 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:58 +0000 (19:59 +0200)
produce_sect() skips sectors without civilians, military and land
units.  These are unowned.  Any uw there are frozen in time: they
don't eat, procreate or produce.  Has always been broken.  Don't skip
such sectors.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/update/sect.c
tests/update/final.xdump
tests/update/journal.log

index 24d311ad8418e1ed990c69a1333899e1f614c779..fb97142fd84f260b001fab30c82462b5aa118b21 100644 (file)
@@ -253,6 +253,7 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
            continue;
        if (sp->sct_updated != 0)
            continue;
+       sp->sct_updated = 1;
 
        /*
         * When running the test suite, reseed PRNG for each sector
@@ -268,13 +269,6 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
            sp = &scratch_sect;
        }
 
-       if (sp->sct_item[I_CIVIL] == 0 && sp->sct_item[I_MILIT] == 0 &&
-           !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) {
-           continue;
-       }
-
-       sp->sct_updated = 1;
-
        work = do_feed(sp, np, etu, 0);
        bp_put_items(bp, sp);
 
index fc102edb9f5bba78247a4f54e5d49b4a072be80d..fd82aa3958db7182bba72391ce0b5f1ac19af724 100644 (file)
@@ -191,7 +191,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
 4 -14 -6 4 0 120 0 0 0 0 0 0 0 -14 -6 0 0 100 0 4 0 0 0 0 0 4 0 2 0 0 0 0 0 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 84 0 0 0 0 0 0 0
 4 -12 -6 14 100 120 0 0 0 0 0 0 0 -12 -6 28 0 58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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 dying 1 0 0 0 0 0 0 0
@@ -303,13 +303,13 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil
 61 1 15 -1 2 20 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 62 7 15 -1 2 20 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 65 2 -8 8 2 20 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
-70 1 16 6 2 20 90 0 20 0 0 none 0 "" 4 10 0 0 0 0 0 0 10 0 10 10 0 0 healthy 0 0 "" 14 6 1 () ""
+70 1 16 6 2 20 90 0 20 0 0 none 0 "" 4 10 0 0 0 0 0 0 9 0 10 10 0 0 healthy 0 0 "" 14 6 1 () ""
 71 1 16 6 2 21 90 0 20 0 0 none 0 "" 4 10 0 0 0 0 0 0 10 0 10 10 0 0 healthy 0 0 "" 14 6 1 () ""
 72 1 16 6 2 21 90 0 20 0 0 none 0 "" 4 10 0 0 0 0 0 0 10 0 10 10 0 0 healthy 0 0 "" 14 6 1 () ""
 73 1 16 6 2 21 90 0 20 0 0 none 0 "" 4 10 0 0 0 0 0 0 9 0 10 10 0 0 healthy 0 0 "" 14 6 1 () ""
-74 1 16 6 2 21 90 0 20 0 0 none 0 "" 12 10 0 0 0 0 0 0 10 0 10 10 0 0 healthy 0 0 "" 14 6 1 () ""
-75 1 16 6 6 21 90 0 20 0 0 none 0 "" 0 11 0 0 0 0 0 0 9 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
-76 1 16 6 6 80 90 0 20 0 0 none 0 "" 0 60 0 0 0 0 0 0 8 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
+74 1 16 6 2 21 90 0 20 0 0 none 0 "" 12 10 0 0 0 0 0 0 9 0 10 10 0 0 healthy 0 0 "" 14 6 1 () ""
+75 1 16 6 6 21 90 0 20 0 0 none 0 "" 0 11 0 0 0 0 0 0 10 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
+76 1 16 6 6 80 90 0 20 0 0 none 0 "" 0 60 0 0 0 0 0 0 9 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 90 1 -8 8 2 100 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 91 1 -14 8 2 20 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 92 1 -2 8 0 20 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
@@ -317,16 +317,16 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil
 95 1 14 6 2 100 90 0 200 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 96 7 14 6 2 20 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 97 1 14 6 2 40 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
-100 1 16 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 37 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
+100 1 16 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 38 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 101 1 18 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 412 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 102 1 20 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 412 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 103 1 18 4 0 73 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 250 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 104 1 18 4 0 33 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 88 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
-110 1 16 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 6 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
+110 1 16 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 5 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 111 1 18 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 51 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 112 1 20 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 51 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 113 1 18 4 8 65 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 30 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
-114 1 18 4 8 25 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 10 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
+114 1 18 4 8 25 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 9 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
 149 0 0 0 0 0 0 0 0 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 0 0 0 () ""
 /config
 config plane
index 245744dc8e67f57e24f061c3d096fcac0d2f6ea9..9e62af01efa97996f05ad6e78e88c9624861132c 100644 (file)
     Play#0 output Play#0 1   1   42 cs   cargo ship    17,1       100%   0  25   0   0  0  0  0  0  90   20
     Play#0 output Play#0 1   1   43 cs   cargo ship    17,1       100%  17  50   0   0  0  0  0  0  90   20
     Play#0 output Play#0 1   1   60 cs   cargo ship    14,6        20%   0   0   0   0  0  0  0  0  90   20
-    Play#0 output Play#0 1   1   70 cs   cargo ship    16,6        20%   4  10   0  10  0  0  0  0  90   20
+    Play#0 output Play#0 1   1   70 cs   cargo ship    16,6        20%   4  10   0   9  0  0  0  0  90   20
     Play#0 output Play#0 1   1   71 cs   cargo ship    16,6        21%   4  10   0  10  0  0  0  0  90   20
     Play#0 output Play#0 1   1   72 cs   cargo ship    16,6        21%   4  10   0  10  0  0  0  0  90   20
     Play#0 output Play#0 1   1   73 cs   cargo ship    16,6        21%   4  10   0   9  0  0  0  0  90   20
-    Play#0 output Play#0 1   1   74 cs   cargo ship    16,6        21%  12  10   0  10  0  0  0  0  90   20
-    Play#0 output Play#0 1   1   75 frg  frigate       16,6        21%   0  11   0   9  0  0  0  0  90   20
-    Play#0 output Play#0 1   1   76 frg  frigate       16,6        80%   0  60   0   8  0  0  0  0  90   20
+    Play#0 output Play#0 1   1   74 cs   cargo ship    16,6        21%  12  10   0   9  0  0  0  0  90   20
+    Play#0 output Play#0 1   1   75 frg  frigate       16,6        21%   0  11   0  10  0  0  0  0  90   20
+    Play#0 output Play#0 1   1   76 frg  frigate       16,6        80%   0  60   0   9  0  0  0  0  90   20
     Play#0 output Play#0 1   7   93 fb   fishing boa    0,0        20%   0   0   0   0  0  0  0  0  90   20
     Play#0 output Play#0 1   1   95 cs   cargo ship    14,6       100%   0   0   0   0  0  0  0  0  90  200
     Play#0 output Play#0 1   7   96 cs   cargo ship    14,6        20%   0   0   0   0  0  0  0  0  90   20
     Play#0 output Play#0 1   1   97 cs   cargo ship    14,6        40%   0   0   0   0  0  0  0  0  90   20
-    Play#0 output Play#0 1   1  100 fb   fishing boa   16,4       100% 100   0   0  37  0  0  0  0  90   20
+    Play#0 output Play#0 1   1  100 fb   fishing boa   16,4       100% 100   0   0  38  0  0  0  0  90   20
     Play#0 output Play#0 1   1  101 fb   fishing boa   18,4       100% 100   0   0 412  0  0  0  0  90   20
     Play#0 output Play#0 1   1  102 fb   fishing boa   20,4       100% 100   0   0 412  0  0  0  0  90   20
     Play#0 output Play#0 1   1  103 fb   fishing boa   18,4        73% 100   0   0 250  0  0  0  0  90   20
     Play#0 output Play#0 1  102 fb     20,4      100% 100   0   0   0   0   0   0   0   0   0   0   0   0
     Play#0 output Play#0 1  103 fb     18,4       73% 100   0   0   0   0   0   0   0   0   0   0   0   0
     Play#0 output Play#0 1  104 fb     18,4       33% 100   0   0   0   0   0   0   0   0   0   0   0   0
-    Play#0 output Play#0 1  110 od     16,4      100% 100   0   0   0   0   0   0   0   0   6   0   0   0
+    Play#0 output Play#0 1  110 od     16,4      100% 100   0   0   0   0   0   0   0   0   5   0   0   0
     Play#0 output Play#0 1  111 od     18,4      100% 100   0   0   0   0   0   0   0   0  51   0   0   0
     Play#0 output Play#0 1  112 od     20,4      100% 100   0   0   0   0   0   0   0   0  51   0   0   0
     Play#0 output Play#0 1  113 od     18,4       65% 100   0   0   0   0   0   0   0   0  30   0   0   0
-    Play#0 output Play#0 1  114 od     18,4       25% 100   0   0   0   0   0   0   0   0  10   0   0   0
+    Play#0 output Play#0 1  114 od     18,4       25% 100   0   0   0   0   0   0   0   0   9   0   0   0
     Play#0 output Play#0 1 30 ships
     Play#0 output Play#0 6 0 640
     Play#0 input plane 0:31,0:15
     Play#0 output Play#0 1   4  -14,-6   -    0%     120 .. ..        0    2    0  100 100%    0    0
     Play#0 output Play#0 1   4  -12,-6   *  100%     120 .. ..       26    0    0   99  58%   28    0
     Play#0 output Play#0 1   4  -10,-6   -    0%     120 .. ..        0    0    0  100 100%    0    0
-    Play#0 output Play#0 1   0   -8,-6   -    0%       0 .. ..        0    0   20  100 100%    0    0
+    Play#0 output Play#0 1   0   -8,-6   -    6%       0 .. ..        0    0   23   99 100%    7    0
     Play#0 output Play#0 1   4   -6,-6   -    3%     120 .. ..       26    0    0  100  72%    4    0
     Play#0 output Play#0 1   4   -4,-6   -    3%     120 .. ..       26    0    0  100  70%    4    0
     Play#0 output Play#0 1   4   -2,-6   -    3%     120 .. ..       26    0    0  100  69%    4    0
     Play#0 output Play#0 1   4  -14,-6   -    0%     0    0    0      0    84    0
     Play#0 output Play#0 1   4  -12,-6   *  100%     0    0    0      0    46    0
     Play#0 output Play#0 1   4  -10,-6   -    0%     0    0    0      0    48    0
-    Play#0 output Play#0 1   0   -8,-6   -    0%     0    0    0      0    79    0
+    Play#0 output Play#0 1   0   -8,-6   -    6%     0    0    0      0    79    0
     Play#0 output Play#0 1   4   -6,-6   -    3%     0    0    0      0    75    0
     Play#0 output Play#0 1   4   -4,-6   -    3%     0    0    0      1     1    0
     Play#0 output Play#0 1   4   -2,-6   -    3%     0    0    0      1     1    0