From a5c7d9b61544100acab16acf65d74e7b157a6cd1 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 21 Aug 2016 11:58:53 +0200 Subject: [PATCH] fix giving items to dead units, https://bugs.eressea.de/view.php?id=2230 --- src/give.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/give.c b/src/give.c index 52b1cda34..80f4a1ab5 100644 --- a/src/give.c +++ b/src/give.c @@ -70,7 +70,11 @@ static void feedback_give_not_allowed(unit * u, order * ord) static bool can_give(const unit * u, const unit * u2, const item_type * itype, int mask) { if (u2) { - if (u->faction != u2->faction) { + if (u2->number==0 && !fval(u2, UFL_ISNEW)) { + // https://bugs.eressea.de/view.php?id=2230 + // cannot give anything to dead units + return false; + } else if (u->faction != u2->faction) { int rule = rule_give(); if (itype) { assert(mask == 0);