]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/move.c
Update copyright notice
[empserver] / src / lib / commands / move.c
index 3733658af43766c0a5ad5a359b3133bda74eaa0b..7c915b8ff6f1b724e79c63663db201df5b10b6f8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, 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,9 +367,9 @@ 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, civs, loyalcivs;
+    int mil, civs;
 
-    if ((vtype != I_CIVIL) && (vtype != I_MILIT))
+    if (vtype != I_CIVIL && vtype != I_MILIT)
        return 0;
 
     mil = sp->sct_item[I_MILIT];
@@ -377,20 +377,9 @@ would_abandon(struct sctstr *sp, i_type vtype, int amnt, struct lndstr *lp)
 
     if (vtype == I_MILIT)
        mil -= amnt;
-
     if (vtype == I_CIVIL)
        civs -= amnt;
 
-    if (sp->sct_own == sp->sct_oldown)
-       loyalcivs = civs;
-    else
-       loyalcivs = 0;
-
-    /* If they have a military unit there, they still own it */
-    if (sp->sct_own != 0
-       && ((loyalcivs == 0) && (mil == 0)
-           && (has_units(sp->sct_x, sp->sct_y, sp->sct_own, lp) == 0)))
-       return 1;
-
-    return 0;
+    return sp->sct_own != 0 && civs <= 0 && mil <= 0
+       && !has_units(sp->sct_x, sp->sct_y, sp->sct_own, lp);
 }