diff --git a/src/lib/update/plague.c b/src/lib/update/plague.c index 05a40c1b..ac526750 100644 --- a/src/lib/update/plague.c +++ b/src/lib/update/plague.c @@ -28,7 +28,7 @@ * * Known contributors to this file: * Steve McClure, 1998-2000 - * Markus Armbruster, 2004-2014 + * Markus Armbruster, 2004-2016 */ #include @@ -99,12 +99,6 @@ do_plague(struct sctstr *sp, struct natstr *np, int etu) break; } } - if (sp->sct_item[I_CIVIL] == 0 && sp->sct_item[I_MILIT] == 0 - && !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) { - makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y); - sp->sct_own = 0; - sp->sct_oldown = 0; - } sp->sct_pstage = pstage; sp->sct_ptime = ptime; } diff --git a/src/lib/update/populace.c b/src/lib/update/populace.c index 04c501bb..a3b02d3f 100644 --- a/src/lib/update/populace.c +++ b/src/lib/update/populace.c @@ -45,18 +45,21 @@ populace(struct natstr *np, struct sctstr *sp, int etu) int civ = sp->sct_item[I_CIVIL]; int mil = sp->sct_item[I_MILIT]; - if (civ == 0 && mil > 0) { + if (!civ) { sp->sct_work = 100; sp->sct_loyal = 0; sp->sct_oldown = sp->sct_own; } - if (!civ && !mil && !sp->sct_item[I_UW] + if (sp->sct_own && !civ && !mil && !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) { makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y); sp->sct_own = 0; sp->sct_oldown = 0; - return; + sp->sct_mobil = 0; } + if (!civ && !mil && !sp->sct_item[I_UW]) + return; + if (sp->sct_own != sp->sct_oldown && sp->sct_loyal == 0) { sp->sct_oldown = sp->sct_own; } diff --git a/src/lib/update/sect.c b/src/lib/update/sect.c index d3127f46..24d311ad 100644 --- a/src/lib/update/sect.c +++ b/src/lib/update/sect.c @@ -268,17 +268,8 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2]) sp = &scratch_sect; } - /* If everybody is dead, the sector reverts to unowned. - * This is also checked at the end of the production in - * they all starved or were plagued off. - */ if (sp->sct_item[I_CIVIL] == 0 && sp->sct_item[I_MILIT] == 0 && !has_units(sp->sct_x, sp->sct_y, sp->sct_own)) { - if (!player->simulation) { - makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y); - sp->sct_own = 0; - sp->sct_oldown = 0; - } continue; } diff --git a/tests/smoke/final.xdump b/tests/smoke/final.xdump index a935a85a..581e02a1 100644 --- a/tests/smoke/final.xdump +++ b/tests/smoke/final.xdump @@ -1108,11 +1108,10 @@ uid owner type amount price maxbidder markettime xbuy ybuy xsell ysell /config config lost timestamp owner type id x y -0 0 0 0 -1 -1 +0 0 1 2 11 -13 0 1 3 1 11 -13 0 1 3 2 10 -14 0 0 1 3 10 -14 -0 0 0 0 -1 -1 /config config realm cnum realm xl xh yl yh diff --git a/tests/update/99-POGO b/tests/update/99-POGO index 167f5374..ddcd1186 100644 --- a/tests/update/99-POGO +++ b/tests/update/99-POGO @@ -187,15 +187,10 @@ land 0:31,-16:-1 | che take over -16:-14,-8 and spread; -14,-8 is a bank | plague stage 4 (dying) -16:-1,-6 ship#10 land#10 | -16,-6 reverts to deity -| BUG mob not reset -| BUG work etc. not reset | -14,-6 resets work etc. | -12,-6 mil all die | -10,-6 resets work etc -| BUG work etc. not reset | -8,-6 reverts to deity -| BUG mob not reset -| BUG work etc. not reset | plague stage 3..1 -16:-1,-5:-3 ship#11..19 land#10..19 | plague stage 0 (healthy) -16:-9,-2, 50% chance to become exposed | -5,-1 tech too low diff --git a/tests/update/final.xdump b/tests/update/final.xdump index 4c3fc5e1..abccd0d8 100644 --- a/tests/update/final.xdump +++ b/tests/update/final.xdump @@ -187,11 +187,11 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd 3 10 -6 4 13 120 0 112 0 0 0 0 0 10 -6 14 0 55 0 4 0 0 0 0 0 3 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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0 4 26 0 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 dying 1 0 0 0 0 0 0 0 @@ -428,7 +428,6 @@ uid owner type amount price maxbidder markettime xbuy ybuy xsell ysell config lost timestamp owner type id x y 0 4 0 0 -8 -6 -0 0 0 0 -8 -6 /config config realm cnum realm xl xh yl yh diff --git a/tests/update/journal.log b/tests/update/journal.log index 590746b7..9c5f2ab6 100644 --- a/tests/update/journal.log +++ b/tests/update/journal.log @@ -1432,11 +1432,11 @@ Play#0 output Play#0 1 4 -5,-7 - 39% 120 .. .. 130 0 0 96 100% 39 0 Play#0 output Play#0 1 4 -3,-7 - 39% 120 .. .. 130 0 0 97 100% 39 0 Play#0 output Play#0 1 4 -1,-7 - 39% 120 .. .. 130 0 0 97 100% 39 0 - Play#0 output Play#0 1 0 -16,-6 - 0% 60 .. .. 0 0 0 100 50% 0 0 1 + Play#0 output Play#0 1 0 -16,-6 - 0% 0 .. .. 0 0 0 100 100% 0 0 1 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 61% 0 0 - Play#0 output Play#0 1 0 -8,-6 - 0% 60 .. .. 0 0 20 100 50% 0 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 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