- Guard-Konvertierung.

This commit is contained in:
Christian Schlittchen 2002-04-21 17:44:17 +00:00
parent 4e076dd4ae
commit cda9b45c1c
6 changed files with 32 additions and 0 deletions

View File

@ -2510,6 +2510,12 @@ void
guard(unit * u, unsigned int mask)
{
int flags = GUARD_CREWS | GUARD_LANDING | GUARD_TRAVELTHRU | GUARD_TAX;
#if GUARD_DISABLES_PRODUCTION == 1
flags |= GUARD_PRODUCE;
#endif
#if GUARD_DISABLES_RECRUIT == 1
flags |= GUARD_RECRUIT;
#endif
switch (old_race(u->race)) {
case RC_ELF:
if (u->faction->race != u->race) break;

View File

@ -32,5 +32,6 @@
#define PEASANTS_DO_NOT_STARVE 0
#define GUARD_DISABLES_RECRUIT 0
#define GUARD_DISABLES_PRODUCTION 0
#define RESOURCE_QUANTITY 1.0

View File

@ -31,6 +31,7 @@
#define PEASANT_ADJUSTMENT 0
#define GUARD_DISABLES_RECRUIT 0
#define GUARD_DISABLES_PRODUCTION 0
#define RESOURCE_QUANTITY 1.0

View File

@ -31,6 +31,8 @@
#define NEW_MIGRATION 1
#define PEASANTS_DO_NOT_STARVE 0
#define GUARD_DISABLES_RECRUIT 1
#define GUARD_DISABLES_PRODUCTION 1
#define RESOURCE_QUANTITY 1.0
#define VICTORY_CONDITION VICTORY_MURDER
#define VICTORY_DELAY 4

View File

@ -31,5 +31,6 @@
#define PEASANT_ADJUSTMENT 0
#define GUARD_DISABLES_RECRUIT 0
#define GUARD_DISABLES_PRODUCTION 0
#define RESOURCE_QUANTITY 1.0

View File

@ -2717,6 +2717,26 @@ fix_seeds(void)
return 0;
}
static int
guard_conversion(void)
{
faction *f;
unit *u;
int mask = GUARD_CREWS | GUARD_LANDING | GUARD_TRAVELTHRU | GUARD_TAX;
for(f=factions; f; f=f->next) {
for(u=f->units; u; u=u->nextF) {
int g = getguard(u);
if( (g & mask) == mask) {
setguard(u, g | GUARD_PRODUCE | GUARD_RECRUIT);
}
}
}
return 0;
}
void
korrektur(void)
{
@ -2766,6 +2786,7 @@ korrektur(void)
do_once("fsee", fix_seeds());
do_once("orc2", orc_conversion2());
do_once("witm", warn_items());
do_once("guac", guard_conversion());
warn_password();
/* seems something fishy is going on, do this just