Author Topic: [fixed] AI worker bug  (Read 1313 times)

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
[fixed] AI worker bug
« on: 28 May 2010, 11:40:02 »
fix for long known AI worker bug, a simple oversight in the end, jda's recent revelations made it rather easy to track down.

unit_type.cpp : 550
Code: [Select]
case ucWorker:
  return hasSkillClass(scBuild) || hasSkillClass(scRepair);

change to,
Code: [Select]
case ucWorker:
  return hasSkillClass(scBuild) || hasSkillClass(scRepair) || hasSkillClass(scHarvest);
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: AI worker bug
« Reply #1 on: 28 May 2010, 23:12:40 »
Thanks for the hint!
What was the exact problem?  I somehow missed the discussion. Workers were not handled by the AI when they had no build or repair skill?
So they were no workers and no warriors and by this completly ignored by the AI ?
« Last Edit: 28 May 2010, 23:26:59 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: AI worker bug
« Reply #2 on: 29 May 2010, 00:16:01 »
...Workers were not handled by the AI when they had no build or repair skill?
So they were no workers and no warriors and by this completly ignored by the AI ?

Exactly :). If they could only harvest the AI didn't consider them workers, so they never get selected when it wants a new worker.  If they also don't have an attack skill, they would never be built at all.
Glest Advanced Engine - Code Monkey

Timeline | Downloads