]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/prod.c
Clean up redundant code in prod()
[empserver] / src / lib / commands / prod.c
index 5babebfe39b08ee576a43e453398c13d8c17056f..882ff28cb79c84b96b7afe78241dc61761e16462 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     David Muir Sharnoff, 1987
  *     Steve McClure, 1997-2000
- *     Markus Armbruster, 2004-2009
+ *     Markus Armbruster, 2004-2010
  */
 
 #include <config.h>
@@ -135,7 +135,6 @@ prod(void)
                eff = 0;
            }
            if (!eff && IS_BIG_CITY(otype) && !IS_BIG_CITY(type)) {
-               natp = getnatp(sect.sct_own);
                maxpop = max_population(natp->nat_level[NAT_RLEV],
                                        type, eff);
                work = new_work(&sect,
@@ -184,12 +183,8 @@ prod(void)
 
            if (sect.sct_own != sect.sct_oldown)
                continue;
-           civs = (1.0 + obrate * etu_per_update) * sect.sct_item[I_CIVIL];
-           natp = getnatp(sect.sct_own);
-           maxpop = max_pop(natp->nat_level[NAT_RLEV], &sect);
-           civs = MIN(civs, maxpop);
            enlisted = 0;
-           maxmil = (civs / 2) - sect.sct_item[I_MILIT];
+           maxmil = MIN(civs, maxpop) / 2 - sect.sct_item[I_MILIT];
            if (maxmil > 0) {
                enlisted = (etu_per_update
                            * (10 + sect.sct_item[I_MILIT])
@@ -214,7 +209,6 @@ prod(void)
            resource = (unsigned char *)&sect + pp->p_nrndx;
        else
            resource = NULL;
-       natp = getnatp(sect.sct_own);
        /*
         * sect p_e  (inc improvements)
         */