do not damage ships with no owner while still in production

This commit is contained in:
Enno Rehling 2010-09-02 23:25:25 -07:00
parent bf5bccc133
commit db8f2f7d0c
1 changed files with 9 additions and 6 deletions

View File

@ -2659,6 +2659,8 @@ sinkships(region * r)
while (*shp) { while (*shp) {
ship * sh = *shp; ship * sh = *shp;
if (!sh->type->construction || sh->size>=sh->type->construction->maxsize) {
if (fval(r->terrain, SEA_REGION) && (!enoughsailors(sh, r) || get_captain(sh)==NULL)) { if (fval(r->terrain, SEA_REGION) && (!enoughsailors(sh, r) || get_captain(sh)==NULL)) {
/* Schiff nicht seetüchtig */ /* Schiff nicht seetüchtig */
damage_ship(sh, 0.30); damage_ship(sh, 0.30);
@ -2666,6 +2668,7 @@ sinkships(region * r)
if (shipowner(sh)==NULL) { if (shipowner(sh)==NULL) {
damage_ship(sh, 0.05); damage_ship(sh, 0.05);
} }
}
if (sh->damage >= sh->size * DAMAGE_SCALE) { if (sh->damage >= sh->size * DAMAGE_SCALE) {
remove_ship(shp, sh); remove_ship(shp, sh);
} }