UFO: Alien Invasion Issue Tracker
star_faded.png
Please log in to bookmark issues
enhancement_small.png
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
     
    Closed
  • Assigned to
     geever
  • Progress
       
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     Namerutan
  • Owned by
    Not owned by anyone
  • Category
    Campaign
  • Resolution
    RESOLVED
  • 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