Display expected trading gain (GainMultiplier = 1) for market foundations when setting rally points. Fixes #1963.

This was SVN commit r13452.
This commit is contained in:
leper 2013-06-05 21:35:31 +00:00
parent b2f6a1260e
commit 5b1f5dd2c1
2 changed files with 6 additions and 2 deletions

View File

@ -277,7 +277,11 @@ function getActionInfo(action, target)
data.target = traderData.secondMarket;
data.source = traderData.firstMarket;
cursor = "action-setup-trade-route";
tooltip = "Click to establish a default route for new traders. Gain: " + gain + " metal.";
tooltip = "Click to establish a default route for new traders.";
if (trader)
tooltip += " Gain: " + gain + " metal.";
else // Foundation or cannot produce traders
tooltip += " Expected gain: " + gain + " metal.";
}
}

View File

@ -25,7 +25,7 @@ function CalculateTraderGain(firstMarket, secondMarket, template)
if (cmpFirstMarketOwnership.GetOwner() != cmpSecondMarketOwnership.GetOwner())
gain *= 1 + INTERNATIONAL_TRADING_ADDITION / 100;
if (template.GainMultiplier)
if (template && template.GainMultiplier)
gain *= template.GainMultiplier;
gain = Math.round(gain);
return gain;