]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/move.c
Update copyright notice
[empserver] / src / lib / commands / move.c
index 8022791fd017abec5f63631b8781d245cfbe08e8..7c915b8ff6f1b724e79c63663db201df5b10b6f8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,9 +26,9 @@
  *  ---
  *
  *  move.c: Move commodities around
- * 
+ *
  *  Known contributors to this file:
- *     
+ *
  */
 
 #include <config.h>
@@ -367,22 +367,19 @@ want_to_abandon(struct sctstr *sp, i_type vtype, int amnt, struct lndstr *lp)
 int
 would_abandon(struct sctstr *sp, i_type vtype, int amnt, struct lndstr *lp)
 {
-    int mil, loyalcivs;
+    int mil, civs;
 
     if (vtype != I_CIVIL && vtype != I_MILIT)
        return 0;
 
     mil = sp->sct_item[I_MILIT];
-    loyalcivs = sp->sct_item[I_CIVIL];
+    civs = sp->sct_item[I_CIVIL];
 
     if (vtype == I_MILIT)
        mil -= amnt;
     if (vtype == I_CIVIL)
-       loyalcivs -= amnt;
-    if (sp->sct_own != sp->sct_oldown)
-       loyalcivs = 0;
+       civs -= amnt;
 
-    return sp->sct_own != 0
-       && loyalcivs == 0 && mil == 0
+    return sp->sct_own != 0 && civs <= 0 && mil <= 0
        && !has_units(sp->sct_x, sp->sct_y, sp->sct_own, lp);
 }