Fix two bugs in attack tooltips. Add an extra Math.round to ensure we don't get huge decimals, and use a building's default arrow count as a minimum in rate calculation.
This was SVN commit r14610.
This commit is contained in:
parent
ea526eedd1
commit
c4643d925d
@ -221,7 +221,7 @@ function displaySingle(entState, template)
|
||||
{
|
||||
var realRange = entState.attack.elevationAdaptedRange;
|
||||
var range = entState.attack.maxRange;
|
||||
attack += ", [font=\"serif-bold-13\"]Range:[/font] " + range +
|
||||
attack += ", [font=\"serif-bold-13\"]Range:[/font] " + Math.round(range) +
|
||||
"[font=\"sans-10\"][color=\"orange\"] meters[/color][/font]";
|
||||
|
||||
if (Math.round(realRange - range) > 0)
|
||||
|
@ -183,9 +183,9 @@ function attackRateDetails(entState) {
|
||||
|
||||
var time = entState.attack.repeatTime / 1000;
|
||||
if (entState.buildingAI) {
|
||||
return arrows + "[font=\"sans-10\"][color=\"orange\"] " + pluralize("arrow", arrows) + "[/color][/font]" +
|
||||
" / " + (time == 1 ? "" : time) + " [font=\"sans-10\"][color=\"orange\"]" + pluralize("second", time) +
|
||||
"[/color][/font]";
|
||||
return Math.max(arrows, entState.buildingAI.defaultArrowCount) + "[font=\"sans-10\"][color=\"orange\"] " +
|
||||
pluralize("arrow", arrows) + "[/color][/font]" + " / " + (time == 1 ? "" : time) +
|
||||
" [font=\"sans-10\"][color=\"orange\"]" + pluralize("second", time) + "[/color][/font]";
|
||||
}
|
||||
return time + "[font=\"sans-10\"][color=\"orange\"] " + pluralize("second", time) + "[/color][/font]";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user