[Freeciv-Dev] Re: Fundamentalism form of government (PR#931)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
>> + if (government_has_flag(g, G_REDUCED_RESEARCH)) {
>> + if (sci_rate > 50) {
>> + tax_rate = 50 - lux_rate;
>> + sci_rate = 50;
>> + }
>> + }
>
>I would write this as:
>
>> + if (government_has_flag(g, G_REDUCED_RESEARCH)) {
>> + if (sci_rate > 50) {
>> + sci_rate = 50;
>> + tax_rate = 100 - sci_rate - lux_rate;
>> + }
>> + }
I can write it that why, but it is clear that has the same effect...
tax_rate = 100 - sci_rate - lux_rate ---> 100 - 50 - lux_rate ---> 50 -
lux_rate
>> + if (government_has_flag(g, G_NO_UNHAPPY_CITIZENS)) {
>> + pcity->ppl_content[4] += pcity->ppl_unhappy[4];
>> + pcity->ppl_unhappy[4] = 0;
>> + pcity->ppl_residue[4] = 0;
>> + }
>
>For robustness this may be written as
>
>> + if (government_has_flag(g, G_NO_UNHAPPY_CITIZENS)) {
>> + pcity->ppl_content[4] += pcity->ppl_unhappy[4] + pcity->ppl_residue[4];
>> + pcity->ppl_unhappy[4] = 0;
>> + pcity->ppl_residue[4] = 0;
>> + }
No, you're wrong. For how residue is implemented, it need not to be
counted. In fact
angry citizen are ALREADY counted as unhappy one.
ppl_unhappy[4] == 4;
ppl_residue[4] == 2;
Don't mean, 4 unhappy and 2 angry
but 2 unhappy and 2 angry. (Unhappy == unhappy - residue, angry ==
residue)
Sorry if this is confusing.
>> /**************************************************************************
>> ...
>> **************************************************************************/
>> +int unit_has_flag(struct unit_type *ut, int flag)
>> +{
>> + assert(flag>=0 && flag<F_LAST);
>> + return BOOL_VAL(ut->flags & (1<<flag));
>> +}
>
>This is a nice addition but it should be included separately.
I can surely include this in a separate file, nontheless, without this
function
is not possible to correctly handle the F_FANATIC flag.
(Clearly I can use this code and substitute the call of the function,
but it is more
prone to errors)
Of course I leave you the final word on implementation problems, so if
you think that
I've to correct the code in the way you pointed, I'll do.
Thanks.
Ciao, Davide
- [Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Davide Pagnin, 2001/09/01
- [Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Christian Knoke, 2001/09/02
- [Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Jason Dorje Short, 2001/09/02
- [Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Raimar Falke, 2001/09/02
- [Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Reinier Post, 2001/09/03
- [Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Raimar Falke, 2001/09/03
- [Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Justin Moore, 2001/09/03
- [Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Miguel Farah F., 2001/09/03
[Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Trent Piepho, 2001/09/02
[Freeciv-Dev] Re: Fundamentalism form of government (PR#931), Davide Pagnin, 2001/09/03
|
|