forked from github/server
- bug noch ungefixt, aber das setzen der coast ist in eine Routine verallgemeinert.
This commit is contained in:
parent
fd5bb54e2f
commit
3b329d952f
|
@ -619,6 +619,17 @@ flying_ship(const ship * sh)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_coast(ship * sh, region * r, region * rnext)
|
||||||
|
{
|
||||||
|
if (rnext->terrain != T_OCEAN && !flying_ship(sh)) {
|
||||||
|
sh->coast = reldirection(rnext, r);
|
||||||
|
assert(rterrain(r)==T_OCEAN);
|
||||||
|
} else {
|
||||||
|
sh->coast = NODIRECTION;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drifting_ships(region * r)
|
drifting_ships(region * r)
|
||||||
{
|
{
|
||||||
|
@ -640,10 +651,12 @@ drifting_ships(region * r)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Kapitän bestimmen */
|
/* Kapitän bestimmen */
|
||||||
for (captain = r->units; captain; captain = captain->next)
|
for (captain = r->units; captain; captain = captain->next) {
|
||||||
if (captain->ship == sh
|
if (captain->ship != sh) continue;
|
||||||
&& eff_skill(captain, SK_SAILING, r) >= sh->type->cptskill)
|
if (eff_skill(captain, SK_SAILING, r) >= sh->type->cptskill) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* Kapitän da? Beschädigt? Genügend Matrosen?
|
/* Kapitän da? Beschädigt? Genügend Matrosen?
|
||||||
* Genügend leicht? Dann ist alles OK. */
|
* Genügend leicht? Dann ist alles OK. */
|
||||||
|
|
||||||
|
@ -679,6 +692,8 @@ drifting_ships(region * r)
|
||||||
/* Das Schiff und alle Einheiten darin werden nun von r
|
/* Das Schiff und alle Einheiten darin werden nun von r
|
||||||
* nach rnext verschoben. Danach eine Meldung. */
|
* nach rnext verschoben. Danach eine Meldung. */
|
||||||
add_regionlist(&route, rnext);
|
add_regionlist(&route, rnext);
|
||||||
|
|
||||||
|
set_coast(sh, r, rnext);
|
||||||
sh = move_ship(sh, r, rnext, route);
|
sh = move_ship(sh, r, rnext, route);
|
||||||
free_regionlist(route);
|
free_regionlist(route);
|
||||||
|
|
||||||
|
@ -686,12 +701,6 @@ drifting_ships(region * r)
|
||||||
|
|
||||||
fset(sh, SF_DRIFTED);
|
fset(sh, SF_DRIFTED);
|
||||||
|
|
||||||
if (rnext->terrain != T_OCEAN && !flying_ship(sh)) {
|
|
||||||
sh->coast = reldirection(rnext, r);
|
|
||||||
assert(rterrain(r)==T_OCEAN);
|
|
||||||
} else {
|
|
||||||
sh->coast = NODIRECTION;
|
|
||||||
}
|
|
||||||
damage_ship(sh, 0.02);
|
damage_ship(sh, 0.02);
|
||||||
|
|
||||||
if (sh->damage>=sh->size * DAMAGE_SCALE) {
|
if (sh->damage>=sh->size * DAMAGE_SCALE) {
|
||||||
|
@ -1685,12 +1694,7 @@ sail(unit * u, region * next_point, boolean move_on_land)
|
||||||
* transferiert wurden, kann der aktuelle Befehl gelöscht werden. */
|
* transferiert wurden, kann der aktuelle Befehl gelöscht werden. */
|
||||||
cycle_route(u, step);
|
cycle_route(u, step);
|
||||||
set_order(&u->thisorder, NULL);
|
set_order(&u->thisorder, NULL);
|
||||||
if (current_point->terrain != T_OCEAN && !is_cursed(sh->attribs, C_SHIP_FLYING, 0)) {
|
set_coast(sh, last_point, current_point);
|
||||||
sh->coast = reldirection(current_point, last_point);
|
|
||||||
assert(rterrain(last_point)==T_OCEAN);
|
|
||||||
} else {
|
|
||||||
sh->coast = NODIRECTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf(buf, "Die %s ", shipname(sh));
|
sprintf(buf, "Die %s ", shipname(sh));
|
||||||
if( is_cursed(sh->attribs, C_SHIP_FLYING, 0) )
|
if( is_cursed(sh->attribs, C_SHIP_FLYING, 0) )
|
||||||
|
|
Loading…
Reference in New Issue