Merge pull request #22 from CTD1/Bug-1857

Bug 1857 abtreiben trotz leuchtturmüberwachung e2
This commit is contained in:
Enno Rehling 2014-08-08 01:00:59 +02:00
commit cad82999d0
2 changed files with 10 additions and 4 deletions

View File

@ -1577,7 +1577,7 @@ bool check_leuchtturm(region * r, faction * f)
if (fval(b, BLD_WORKING) && b->size >= 10) {
int maxd = (int)log10(b->size) + 1;
if (skill_enabled(SK_PERCEPTION)) {
if (skill_enabled(SK_PERCEPTION) && f) {
region *r2 = b->region;
unit *u;
int c = 0;

View File

@ -1763,9 +1763,15 @@ sail(unit * u, order * ord, bool move_on_land, region_list ** routep)
/* storms should be the first thing we do. */
stormchance = stormyness / shipspeed(sh, u);
if (check_leuchtturm(next_point, NULL))
stormchance /= 3;
if (check_leuchtturm(next_point, NULL)) {
int param = get_param_int(global.parameters, "rules.lighthous.stormchancedevisor", 0);
if (param > 0) {
stormchance /= param;
}
else {
stormchance = 0;
}
}
if (rng_int() % 10000 < stormchance * sh->type->storm
&& fval(current_point->terrain, SEA_REGION)) {
if (!is_cursed(sh->attribs, C_SHIP_NODRIFT, 0)) {