Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#318 Component capture/destroy is too much

closed-fixed
Cord Awtry
Server (93)
5
2011-09-23
2011-09-19
Cord Awtry
No

If you have an OP that captures/destroys components, it likely does too much. This is because when it is looping through the factories, it simply checks if it is less than it's maximum and if it is then take everything from a factory instead of only what it needs to satisfy the mission.

Example:
Planet A has medium and heavy mek factories
Faction A has 499,000 medium mek comps and 500,000 heavy mek comps
Faction B wins raid and should capture 501,000 components

While the amount captured/destroyed is less than the amount that it should capture/destroy, the code iterates over the list of factories. From the current factory it simply takes everything it has then checks to see if it's over the level or not. This can result in WAY too much being taken because, in the above example, if it first takes 499,000 medium mek components, this is below the 501,000 total it is supposed to take, although only 2,000 under. Next it will hit the heavy factory and take all 500,000 components, instead of 2,000, meaning the raid that was supposed to take only 501,000 actually took 999,000 components, almost double what it should.

Discussion

  • Cord Awtry
    Cord Awtry
    2011-09-19

    • status: open --> open-fixed
     
  • Cord Awtry
    Cord Awtry
    2011-09-19

    Fixed in check-in 1323

     
  • Cord Awtry
    Cord Awtry
    2011-09-23

    • status: open-fixed --> closed-fixed