Do not cast to float where usual arithmetic conversions obviously
convert the cast's result to double. Such casts are ugly and may lose precision.
This commit is contained in:
parent
802f69b039
commit
7a99405942
14 changed files with 35 additions and 35 deletions
|
@ -204,13 +204,13 @@ scuttle_tradeship(struct shpstr *sp, int interactive)
|
|||
if (dist < trade_1_dist)
|
||||
cash = 0;
|
||||
else if (dist < trade_2_dist)
|
||||
cash = (1.0 + trade_1 * ((float)dist));
|
||||
cash = 1.0 + trade_1 * dist;
|
||||
else if (dist < trade_3_dist)
|
||||
cash = (1.0 + trade_2 * ((float)dist));
|
||||
cash = 1.0 + trade_2 * dist;
|
||||
else
|
||||
cash = (1.0 + trade_3 * ((float)dist));
|
||||
cash = 1.0 + trade_3 * dist;
|
||||
cash *= mp->m_cost;
|
||||
cash *= (((float)sp->shp_effic) / 100.0);
|
||||
cash *= sp->shp_effic / 100.0;
|
||||
|
||||
if (sect.sct_own != sp->shp_own) {
|
||||
ally_cash = cash * trade_ally_cut;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue