Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: patch: Pangea
Home

[Freeciv-Dev] Re: patch: Pangea

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Freeciv List" <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: patch: Pangea
From: "Peter Schaefer" <schaefer@xxxxxx>
Date: Sun, 21 May 2000 19:16:23 +0200

>If checkmass<0 , more land has been placed than was requested initially.
>
>The value of i should indicate how much land has been requested more than
>has been placed.
>{ freelog(LOG_NORMAL,"mapgen.c: mass doesn't sum up."); return i; }
>
>Guessing, might be caused by:
>
>-generous rounding somewhere
>- off by one error when setting up the buckets in makeisland, at
>least when compared to the use in fillisland:
>#1096  if (*bucket <= 0 ) return;
>#1097   capac = totalmass;
>#1098   i = *bucket / capac;
>#1099   i++;
>#1100   *bucket -= i * capac;
>#1101
>I always have a bad feeling with this, but I cant place my finger on it :-|
>Maybe it is because capac is an int, not a long int like totalmass ..
>but then it think total mass is long only so that all expressions
>using totalmass become long int :-P
>

If sizeof(int)<4, capac defininitely should be a long int.
What is it on your system ?





[Prev in Thread] Current Thread [Next in Thread]