1
0
forked from 0ad/0ad

Fix training/researching with zero time.

(Re)introduced in 0c4f59d0a7.
Reported by: @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D4378
Reviewed by: @Silier
Refs. #2334

This was SVN commit r26089.
This commit is contained in:
Freagarach 2021-12-21 06:19:50 +00:00
parent a8c6d7a82b
commit 84399ba248
2 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ Researcher.prototype.Item.prototype.GetBasicInfo = function()
{
return {
"technologyTemplate": this.templateName,
"progress": 1 - (this.timeRemaining / this.timeTotal),
"progress": 1 - (this.timeRemaining / (this.timeTotal || 1)),
"timeRemaining": this.timeRemaining,
"paused": this.paused,
"metadata": this.metadata

View File

@ -365,7 +365,7 @@ Trainer.prototype.Item.prototype.GetBasicInfo = function()
"unitTemplate": this.templateName,
"count": this.count,
"neededSlots": this.missingPopSpace,
"progress": 1 - (this.timeRemaining / this.timeTotal),
"progress": 1 - (this.timeRemaining / (this.timeTotal || 1)),
"timeRemaining": this.timeRemaining,
"paused": this.paused,
"metadata": this.metadata