Make the code compile on Visual Studio again, fixing type conversion warnings and C99-isms.

Signed-off-by: Enno Rehling <enno@eressea.de>
This commit is contained in:
Enno Rehling 2011-03-06 17:00:39 -08:00
parent d672510f06
commit d75ee1a057
4 changed files with 9 additions and 8 deletions

View File

@ -2677,11 +2677,11 @@ sinkships(region * r)
if (!sh->type->construction || sh->size>=sh->type->construction->maxsize) {
if (fval(r->terrain, SEA_REGION) && (!enoughsailors(sh, r) || get_captain(sh)==NULL)) {
/* Schiff nicht seetüchtig */
float dmg = get_param_flt(global.parameters, "rules.ship.damage.nocrewocean", 0.30);
float dmg = get_param_flt(global.parameters, "rules.ship.damage.nocrewocean", 0.30F);
damage_ship(sh, dmg);
}
if (shipowner(sh)==NULL) {
float dmg = get_param_flt(global.parameters, "rules.ship.damage.nocrew", 0.05);
float dmg = get_param_flt(global.parameters, "rules.ship.damage.nocrew", 0.05F);
damage_ship(sh, dmg);
}
}

View File

@ -855,7 +855,7 @@ move_iceberg(region *r)
for (sh = r->ships; sh; sh = sh->next) {
/* Meldung an Kapitän */
float dmg = get_param_flt(global.parameters, "rules.ship.damage.intoiceberg", 0.10);
float dmg = get_param_flt(global.parameters, "rules.ship.damage.intoiceberg", 0.10F);
damage_ship(sh, dmg);
fset(sh, SF_SELECT);
}
@ -866,8 +866,8 @@ move_iceberg(region *r)
translist(&rc->buildings, &r->buildings, rc->buildings);
}
while (rc->ships) {
float dmg = get_param_flt(global.parameters, "rules.ship.damage.withiceberg", 0.10F);
fset(rc->ships, SF_SELECT);
float dmg = get_param_flt(global.parameters, "rules.ship.damage.withiceberg", 0.10);
damage_ship(rc->ships, dmg);
move_ship(rc->ships, rc, r, NULL);
}
@ -994,7 +994,7 @@ godcurse(void)
ship *sh;
for (sh = r->ships; sh;) {
ship *shn = sh->next;
float dmg = get_param_flt(global.parameters, "rules.ship.damage.godcurse", 0.10);
float dmg = get_param_flt(global.parameters, "rules.ship.damage.godcurse", 0.10F);
damage_ship(sh, dmg);
if (sh->damage>=sh->size * DAMAGE_SCALE) {
unit * u = shipowner(sh);

View File

@ -2635,8 +2635,9 @@ aftermath(battle * b)
boolean ships_damaged = (boolean)(b->turn+(b->has_tactics_turn?1:0)>2); /* only used for ship damage! */
for (s=b->sides;s!=b->sides+b->nsides;++s) {
s->dead=0;
fighter * df;
s->dead=0;
for (df = s->fighters; df; df=df->next) {
unit *du = df->unit;
int dead = dead_fighters(df);
@ -2884,7 +2885,7 @@ aftermath(battle * b)
if (sh && fval(sh, SF_DAMAGED)) {
int n = b->turn - 2;
if (n>0) {
float dmg = get_param_flt(global.parameters, "rules.ship.damage.battleround", 0.05);
float dmg = get_param_flt(global.parameters, "rules.ship.damage.battleround", 0.05F);
damage_ship(sh, dmg * n);
freset(sh, SF_DAMAGED);
}

View File

@ -1765,8 +1765,8 @@ sail(unit * u, order * ord, boolean move_on_land, region_list **routep)
if (check_leuchtturm(current_point, NULL)) {
ADDMSG(&f->msgs, msg_message("sailnolandingstorm", "ship", sh));
} else {
float dmg = get_param_flt(global.parameters, "rules.ship.damage.nolanding", 0.10F);
ADDMSG(&f->msgs, msg_message("sailnolanding", "ship region", sh, next_point));
float dmg = get_param_flt(global.parameters, "rules.ship.damage.nolanding", 0.10);
damage_ship(sh, dmg);
/* we handle destruction at the end */
}