Bug 1861: increase MAXTEACHERS, warn if it is still too small.

This commit is contained in:
Enno Rehling 2015-07-02 16:23:38 +02:00
parent bfd93c68b2
commit f054ea114b
2 changed files with 7 additions and 2 deletions

View File

@ -42,6 +42,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <util/attrib.h>
#include <util/base36.h>
#include <util/language.h>
#include <util/log.h>
#include <util/parser.h>
#include <util/rand.h>
#include <util/umlaut.h>
@ -217,8 +218,12 @@ bool report, int *academy)
}
if (index < MAXTEACHERS)
teach->teachers[index++] = teacher;
if (index < MAXTEACHERS)
if (index < MAXTEACHERS) {
teach->teachers[index] = NULL;
}
else {
log_warning("MAXTEACHERS is too low at %d", MAXTEACHERS);
}
teach->value += n;
/* Solange Akademien groessenbeschraenkt sind, sollte Lehrer und

View File

@ -32,7 +32,7 @@ extern "C" {
extern bool is_migrant(struct unit *u);
extern int study_cost(struct unit *u, skill_t talent);
#define MAXTEACHERS 4
#define MAXTEACHERS 8
typedef struct teaching_info {
struct unit *teachers[MAXTEACHERS];
int value;