]> git.pond.sub.org Git - empserver/commitdiff
Make would_abandon() more robust
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 24 Mar 2008 09:08:54 +0000 (10:08 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 26 Mar 2008 21:10:28 +0000 (22:10 +0100)
Do the right thing when caller passes a larger amount than actually
there.

src/lib/commands/move.c

index 8022791fd017abec5f63631b8781d245cfbe08e8..e185b7734a037e581a84f63a11aeffad1d21cd3d 100644 (file)
@@ -383,6 +383,6 @@ would_abandon(struct sctstr *sp, i_type vtype, int amnt, struct lndstr *lp)
        loyalcivs = 0;
 
     return sp->sct_own != 0
-       && loyalcivs == 0 && mil == 0
+       && loyalcivs <= 0 && mil <= 0
        && !has_units(sp->sct_x, sp->sct_y, sp->sct_own, lp);
 }