Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11354) log(0.0) causes a server crash
Home

[Freeciv-Dev] (PR#11354) log(0.0) causes a server crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ph.bayon@xxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#11354) log(0.0) causes a server crash
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 12 Dec 2004 11:23:51 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11354 >

In this check:

    if (log_desirable + pos.total_MC * logDF 
               > log_most_desirable + best_MC * logDF) {

the RHS values are all initialized to 0 but since we're dealing with
logs the LHS can often be negative.  A log_most_desirable of 0 indicates
most_desirable is 1 and a best_MC of 0 is the best possible value!  So
log_most_desirable should be -FC_INFINITY and best_MC should be FC_INFINITY.

When I make this changes the problem with far-away exploration
demonstrated in my other savegame is fixed.  However this makes
autogames to be *even more* different.

-jason




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