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)
This commit is contained in:
TomBraun 2014-06-25 13:15:37 +02:00
parent a75d91fb6d
commit 84fb776d1c
1 changed files with 2 additions and 1 deletions

View File

@ -774,7 +774,8 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
fset(b, BLD_MAINTAINED); fset(b, BLD_MAINTAINED);
/* Die Einheit befindet sich automatisch im Inneren der neuen Burg. */ /* 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); u_set_building(u, b);
assert(building_owner(b)==u); assert(building_owner(b)==u);
} }