diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index aa6beb713..a68dbdf71 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -2371,9 +2371,6 @@ remove_empty_factions(boolean writedropouts) /* monster (0) werden nicht entfernt. alive kann beim readgame * () auf 0 gesetzt werden, wenn monsters keine einheiten mehr * haben. */ -#ifdef MAXAGE - if (f->age > MAXAGE) f->alive = 0; -#endif if (f->alive == 0 && f->no != MONSTER_FACTION) { ursprung * ur = f->ursprung; while (ur && ur->id!=0) ur=ur->next; @@ -2430,7 +2427,10 @@ remove_empty_units_in_region(region *r) while (*up) { unit * u = *up; - + faction * f = u->faction; +#ifdef MAXAGE + if (f->age > MAXAGE) set_number(u, 0); +#endif if ((u->number <= 0 && u->race != new_race[RC_SPELL]) || (u->age <= 0 && u->race == new_race[RC_SPELL]) || u->number < 0) { diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 054b8bae8..e6f09fdb0 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -1550,7 +1550,12 @@ readunit(FILE * F) u_setfaction(u, findfaction(n = ri(F))); if (u->faction == NULL) { log_error(("unit %s has faction == NULL\n", unitname(u))); +#if 0 abort(); +#else + u_setfaction(u, findfaction(MONSTER_FACTION)); + set_number(u, 0); +#endif } if (playerrace(u->race)) { u->faction->no_units++; diff --git a/src/mapper/Makefile b/src/mapper/Makefile index 6819b0065..fa3057027 100644 --- a/src/mapper/Makefile +++ b/src/mapper/Makefile @@ -17,19 +17,24 @@ INCLUDES += \ -I../common \ -I.. +LIBNAMES += \ + e-triggers \ + e-modules \ + e-kernel \ + e-items \ + e-spells \ + e-races \ + e-attributes \ + e-util \ + e-modules + LIBS += \ -L$(PUBLISH_DIR) \ - -le-triggers \ - -le-modules \ - -le-kernel \ - -le-items \ - -le-spells \ - -le-races \ - -le-attributes \ - -le-util \ - -le-modules \ -lm +LIBDEPS = $(LIBNAMES:%=../$(BUILD_DIR)/lib%.a) +LIBS += $(LIBNAMES:%=-l%) + ifeq ($(NCURSES), 1) LIBS += -lncurses else @@ -47,7 +52,7 @@ ifeq ($(CONVERT_TRIGGERS), 1) endif # executable: -$(BUILD_DIR)/$(BINARY):: $(BUILD_DIR) $(OBJECTS) +$(BUILD_DIR)/$(BINARY):: $(BUILD_DIR) $(OBJECTS) $(LIBDEPS) $(LD) -o $@ $(OBJECTS) $(LDFLAGS) $(INSTALL) $@ $(PUBLISH_DIR)/