Re: [Freeciv-Dev]  Bug in savegame loading?
[Top] [All Lists]
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
David Pfitzner <dwp@xxxxxxxxxxxxxx>
> 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. 
Actually there are some other things in player_load()
which are also ruleset (or unitialized memory) dependent.
Specifically update_research() and city_incite_cost()
(the latter because city_got_building() depends on
improvement_exists() which depends on rulesets; not 
sure if this can be eliminated similarly to unit_bribe_cost).
Its problematic to load rulesets prior to calling player_load()
(due to strbuffer constraints on only having one registry
open at a time, which should really be fixed sometime)
but it should be straightforward to move these things
to just after rulesets are loaded.
-- David
 
 
 
 | 
 |