From 84fb776d1c75f9af008e36292cf01c6b5a0db111 Mon Sep 17 00:00:00 2001 From: TomBraun Date: Wed, 25 Jun 2014 13:15:37 +0200 Subject: [PATCH] Fixed a bug that crasehed the server when Stonegolems created a new building and the whole unite was consumed during this process (could not enter the new building as no one was left in the unit) --- src/kernel/build.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kernel/build.c b/src/kernel/build.c index 86b390755..79b7d7567 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -774,7 +774,8 @@ build_building(unit * u, const building_type * btype, int want, order * ord) fset(b, BLD_MAINTAINED); /* Die Einheit befindet sich automatisch im Inneren der neuen Burg. */ - if (leave(u, false)) { + /* Check if unit still have member, as stonegolems are destroyed during construction*/ + if (leave(u, false) && u->number >> 0) { u_set_building(u, b); assert(building_owner(b)==u); }