From ce94c9805d85af797739449f3f7a1b16a25320b5 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 28 Apr 2015 17:40:41 +0200 Subject: [PATCH] =?UTF-8?q?rules.give.max=5Fmen=20=3D=3D=20-1=20f=C3=BCr?= =?UTF-8?q?=20unlimitierte=20=C3=9Cbergaben=20in=20E2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/e2/config.xml | 2 +- src/give.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/conf/e2/config.xml b/conf/e2/config.xml index 980671bcf..f99176432 100644 --- a/conf/e2/config.xml +++ b/conf/e2/config.xml @@ -94,7 +94,7 @@ - + diff --git a/src/give.c b/src/give.c index 93cba504e..d22a09c73 100644 --- a/src/give.c +++ b/src/give.c @@ -244,6 +244,7 @@ message * give_men(int n, unit * u, unit * u2, struct order *ord) int k = 0; int error = 0; message * msg; + int maxt = max_transfers(); assert(u2); @@ -303,7 +304,7 @@ message * give_men(int n, unit * u, unit * u2, struct order *ord) error = 96; } else if (u->faction != u2->faction) { - if (u2->faction->newbies + n > max_transfers()) { + if (maxt>=0 && u2->faction->newbies + n > maxt) { error = 129; } else if (u_race(u) != u2->faction->race) { @@ -365,7 +366,7 @@ message * give_men(int n, unit * u, unit * u2, struct order *ord) set_leftship(u2, sh); } transfermen(u, u2, n); - if (u->faction != u2->faction) { + if (maxt>=0 && u->faction != u2->faction) { u2->faction->newbies += n; } }