Re: [Freeciv-Dev] Bug in savegame loading?
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
|
|