]> git.pond.sub.org Git - empserver/commitdiff
(produce_sect): Game state changes may be changed only if
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Sep 2006 10:47:58 +0000 (10:47 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Sep 2006 10:47:58 +0000 (10:47 +0000)
player->simulation.  Fix a missing guard.  Existing callers should not
need it.

src/lib/update/sect.c

index ea7238b28da9d38477d77b0e57562db88b7623e6..b27c1874324d1acf9df23e5db60a42181ff29a90 100644 (file)
@@ -291,14 +291,16 @@ produce_sect(int natnum, int etu, int *bp, long p_sect[][2])
            vec = sp->sct_item;
 
        /* 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.
+        * This is also checked at the end of the production in
+        * they all starved or were plagued off.
         */
        if (vec[I_CIVIL] == 0 && vec[I_MILIT] == 0 &&
            !has_units(sp->sct_x, sp->sct_y, sp->sct_own, 0)) {
-           makelost(EF_SECTOR, sp->sct_own, 0, sp->sct_x, sp->sct_y);
-           sp->sct_own = 0;
-           sp->sct_oldown = 0;
+           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;
        }