Complete.Org: Mailing Lists: Archives: freeciv-dev: March 1999:
Re: [Freeciv-Dev] Bug in savegame loading?
Home

Re: [Freeciv-Dev] Bug in savegame loading?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: falk.hueffner@xxxxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Bug in savegame loading?
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Thu, 11 Mar 1999 22:24:41 +1100

Falk Hueffner wrote:

> with a not-really-recent client I had crashes when loading games. It
> was probably because the rulesets were not yet loaded when the server was
> trying to calculate bribing cost and dividing by the yet uninitialitzed
> max hitpoints.

You are correct.  What I wonder is whether bribe_cost should
be calculated here at all.  Rather it should be calculated as
required, especially since many of the things it depends on 
may change.   In practice this is what happens, though it does
depend on the client nicely sending a PACKET_INCITE_INQ (to
get the bribe cost) before sending a PACKET_DIPLOMAT_ACTION:
DIPLOMAT_BRIBE.

So probably the unit_bribe_cost calls in plrhand.c:player_load(),
and also unitfunc.c:create_unit_full() should simply be removed.

I'm not sure whether unitfunc.c:diplomat_bribe() should
call unit_bribe_cost() to get an up-to-date value and in case
the client didn't do the right things above.  The reason possibly
not is that then the client may spend a different amount that the
player clicked 'ok' to...

-- David

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