Jump to content

resourcesUsed counter bug


KarloManco
 Share

Recommended Posts

When a unit which is being trained is cancelled, the resourcesUsed counter is decreased by twice the cost of this unit.
Steps to reproduce:
1. Click on any building to train a new unit
2. Cancel the unit before it is completed.
3. Check in the summary the Resources Used field

I tested it with:

cmd 1 {"type":"train","template":"units/rome/support_female_citizen","count":1,"entities":[150],"pushFront":false}
cmd 1 {"type":"stop-production","entity":150,"id":1}

and got resourcesUsed = -50

I am not a professional programmer but, in case it helps, the problem seems to be in: binaries > data > mods > public > simulation > components > Trainer.js > Trainer > Item > Stop

There is a call to IncreaseResourceUsedCounter() in line 154 to decrease its value and a call to RefundResources() in line 161 which contains another call to IncreaseResourceUsedCounter(). Looks like this is why the value is decreased twice.

I have checked (in the newest version, rev 27288) that by commenting lines 153 and 154 in the mentioned file (Trainer.js) the issue sees to be solved.


PD: Thanks for this fabulous game. It is really awesome.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...