Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4720 closed defect (fixed)

Mistyped variable name in AI code.

Reported by: s0600204 Owned by: mimo
Priority: Should Have Milestone: Alpha 23
Component: AI Keywords:
Cc: Patch:

Description

simulation/ai/common-ai/entity.js:313 should use bonusClass not bonusesClasses.

This is part of how the AI reads the Attack component or entities, specifically any bonuses an entity should have against certain classes.

This (technically) affects anyone trying to play with AI with the last two releases or with svn.

I would gather that the reason it hasn't been noticed until now is because the problematic line of code only gets called under specific circumstances: when preparing to attack a target that happens to have a class that a unit under consideration for training happens to have a bonus against. That doesn't happen very often, evidently.

Full error message:

ERROR: JavaScript error: simulation/ai/common-api/entity.js line 313
ReferenceError: bonusesClasses is not defined
  m.Template<.getMultiplierAgainst@simulation/ai/common-api/entity.js:313:1
  m.getMaxStrength@simulation/ai/petra/entityExtend.js:28:12
  m.HQ.prototype.findBestTrainableUnit/<@simulation/ai/petra/headquarters.js:570:18
  m.HQ.prototype.findBestTrainableUnit@simulation/ai/petra/headquarters.js:554:2
  m.AttackPlan.prototype.trainMoreUnits@simulation/ai/petra/attackPlan.js:557:19
  m.AttackPlan.prototype.updatePreparation@simulation/ai/petra/attackPlan.js:440:4
  m.AttackManager.prototype.update@simulation/ai/petra/attackManager.js:140:21
  m.HQ.prototype.update@simulation/ai/petra/headquarters.js:2286:3
  m.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:119:3
  m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

Bug introduced in r18250.

Change History (2)

comment:1 by mimo, 7 years ago

Resolution: fixed
Status: assignedclosed

In 19981:

AI:fix typo spotted by s0600204, fixes #4720

comment:2 by mimo, 7 years ago

Milestone: BacklogAlpha 23
Note: See TracTickets for help on using tickets.