UFO: Alien Invasion Issue Tracker
Please log in to bookmark issues
CLOSED  Submit Patch #5640  -  Improve happiness calculation from missions
Posted Feb 02, 2017 - updated Feb 17, 2018
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Submit Patch
  • Status
  • Assigned to
  • Progress
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
  • Owned by
    Not owned by anyone
  • Category
  • Resolution
  • Priority
    Not determined
  • Targetted for
    icon_milestones.png Not determined
Issue description
If there are no civilians in a mission (most the planet where an ufo can be downed), there is no change in the happiness for any country.

I guess there was a possible division by zero if civilianSum was zero, but the result was no change on happiness even if you got a good performance killing aliens.

The performance was calculated as follows: For civilians = 0 -> performance = 0 For civilians > 0 -> performance = performanceCivilian + performanceAlien

This patch changes this as follows: For civilians = 0 -> performanceCivilian = 0 For any amount -> performance = performanceCivilian + performanceAlien