forked from github/server
Bug 1861: increase MAXTEACHERS, warn if it is still too small.
This commit is contained in:
parent
bfd93c68b2
commit
f054ea114b
|
@ -42,6 +42,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <util/attrib.h>
|
#include <util/attrib.h>
|
||||||
#include <util/base36.h>
|
#include <util/base36.h>
|
||||||
#include <util/language.h>
|
#include <util/language.h>
|
||||||
|
#include <util/log.h>
|
||||||
#include <util/parser.h>
|
#include <util/parser.h>
|
||||||
#include <util/rand.h>
|
#include <util/rand.h>
|
||||||
#include <util/umlaut.h>
|
#include <util/umlaut.h>
|
||||||
|
@ -217,8 +218,12 @@ bool report, int *academy)
|
||||||
}
|
}
|
||||||
if (index < MAXTEACHERS)
|
if (index < MAXTEACHERS)
|
||||||
teach->teachers[index++] = teacher;
|
teach->teachers[index++] = teacher;
|
||||||
if (index < MAXTEACHERS)
|
if (index < MAXTEACHERS) {
|
||||||
teach->teachers[index] = NULL;
|
teach->teachers[index] = NULL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log_warning("MAXTEACHERS is too low at %d", MAXTEACHERS);
|
||||||
|
}
|
||||||
teach->value += n;
|
teach->value += n;
|
||||||
|
|
||||||
/* Solange Akademien groessenbeschraenkt sind, sollte Lehrer und
|
/* Solange Akademien groessenbeschraenkt sind, sollte Lehrer und
|
||||||
|
|
|
@ -32,7 +32,7 @@ extern "C" {
|
||||||
extern bool is_migrant(struct unit *u);
|
extern bool is_migrant(struct unit *u);
|
||||||
extern int study_cost(struct unit *u, skill_t talent);
|
extern int study_cost(struct unit *u, skill_t talent);
|
||||||
|
|
||||||
#define MAXTEACHERS 4
|
#define MAXTEACHERS 8
|
||||||
typedef struct teaching_info {
|
typedef struct teaching_info {
|
||||||
struct unit *teachers[MAXTEACHERS];
|
struct unit *teachers[MAXTEACHERS];
|
||||||
int value;
|
int value;
|
||||||
|
|
Loading…
Reference in New Issue