URL:
  <http://gna.org/bugs/?22824>

                 Summary: multiplayer ruleset: Savegames not portable against
ruleset changes due to saved script variables
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Sat 18 Oct 2014 12:53:59 BST
                Category: rulesets
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: 

    _______________________________________________________

Details:

In a savegame of the multiplayer ruleset, the following state is saved:


[script]
code=$$
vars=$phil_tech=find.tech_type(60)
phil_id=60
darw_id=44
tevo_tech=find.tech_type(89)
darw_btype=find.building_type(44)
$


This hardcodes numeric indexes of ruleset objects from the currently loaded
ruleset. If the ruleset is rearranged so that objects have different indices,
this bypasses the usual savegame compatibility arrangements for that.

Probably the script should just look these up on demand; I can't see any
impact other than performance, and a minor one at that.

(I wasn't sure whether file-scope variable assignments might be re-evaluated
at savegame load. It seems they aren't; I guess they're evaluated at ruleset
load and then stomped by anything in the savegame. If I save a game and then
rearrange buildings.ruleset:


jtn: 'lua cmd log.normal((find.building_type("Darwin's Voyage")).id)'
/lua: 43
jtn: 'lua cmd log.normal(darw_id)'
/lua: 44





    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?22824>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to