URL:
  <http://gna.org/bugs/?15319>

                 Summary: Military units don't make citizens quite unhappy
enough
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Tuesday 09/02/10 at 01:16
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: Ready For Test
             Assigned to: jtn
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: 2.1.12,2.2.0

    _______________________________________________________

Details:

I think there's a loss of one point of unhappiness-from-units.

In common/city.c:citizen_happy_units() we have the following code:


  /* Now make citizens unhappier because of military units away from home.
   * First make content => unhappy, then happy => unhappy,
   * then happy => content. */
  amt = pcity->unit_happy_upkeep;
  while (amt > 0 && *content > 0) {
    (*content)--;
    (*unhappy)++;
    amt--;
  }
  while (amt > 1 && *happy > 0) {
    (*happy)--;
    (*unhappy)++;
    amt -= 2;
  }
  while (amt > 0 && *content > 0) {
    (*content)--;
    (*unhappy)++;
    amt--;
  }


The code is inconsistent with the comment: there's no code to make happy
citizens content. Also, the last while() can't do anything: any content
citizens will have been mopped up by the first loop, and the second can't
change that.

Looks like a simple copy-and-paste error. Applies to S2_1 and S2_2.

(There's also a comment that this could be extended to create angry citizens,
but that's a job for another bug.)



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tuesday 09/02/10 at 01:16  Name: S2_2-bring-the-boys-back-home.diff 
Size: 457B   By: jtn
Make life slightly more miserable
<http://gna.org/bugs/download.php?file_id=8009>
-------------------------------------------------------
Date: Tuesday 09/02/10 at 01:16  Name: S2_1-bring-the-boys-back-home.diff 
Size: 457B   By: jtn
Make life slightly more miserable
<http://gna.org/bugs/download.php?file_id=8010>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?15319>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to