diff --git a/conf/e3/config.xml b/conf/e3/config.xml index 55d020ae6..36b5a692c 100644 --- a/conf/e3/config.xml +++ b/conf/e3/config.xml @@ -118,6 +118,7 @@ + diff --git a/critbit b/critbit index 2a7af5e23..2d901a238 160000 --- a/critbit +++ b/critbit @@ -1 +1 @@ -Subproject commit 2a7af5e2347217ea4efcf7fb3f0bc9c2681d1a17 +Subproject commit 2d901a238b98b14204f9118abc5040ff4904052c diff --git a/src/kernel/config.h b/src/kernel/config.h index c02c1916c..bca500ab9 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -65,9 +65,6 @@ extern "C" { #define PLAGUE_HEALCHANCE 0.25F /* Wahrscheinlichkeit Heilung */ #define PLAGUE_HEALCOST 30 /* Heilkosten */ - /* Chance of a monster attack */ -#define MONSTERATTACK 0.4F - /* Bewegungsweiten: */ #define BP_WALKING 4 #define BP_RIDING 6 diff --git a/src/monsters.c b/src/monsters.c index a882a941c..9b8f680d5 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -132,6 +132,10 @@ static void reduce_weight(unit * u) } } +static float monster_attack_chance(void) { + return get_param_flt(global.parameters, "rules.monsters.attack_chance", 0.4f); +} + static order *monster_attack(unit * u, const unit * target) { if (u->region != target->region) @@ -747,7 +751,7 @@ void plan_monsters(faction * f) for (r = regions; r; r = r->next) { unit *u; - double attack_chance = MONSTERATTACK; + double attack_chance = monster_attack_chance(); bool attacking = false; for (u = r->units; u; u = u->next) {