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

Newlines in lua scripts are saved as the \n char combination in
savegames, and in stings that continue over newlines (continued with \
then newline), that is saved as \\n in the savegame. When the savegame
is restored, newlines are inserted in the strings causing lua syntax

The result is that the lua script is not run properly when loading games.

Using 2.1 branch r13060
To reproduce:
Start a new game with the tutorial scenario
Save during the first turn
Leave, load the save

>From server log:
3: Trying "default/script.lua".
lua error:
        [string "script.code"]:5: unfinished string near `"Welcome to
Freeciv.  You lead a civilization.  Your'

             2: function turn_callback(turn, year)
             3:   if turn == 0 then
             4:     notify.event(nil, nil, E.TUTORIAL,
        -->  5: _("Welcome to Freeciv.  You lead a civilization.  Your
             6: task is to conquer the world!  You should start by
             7: exploring the land around you with your explorer,
             8: and using your settlers to find a good place to build

lua error:
        attempt to call a table value
stack traceback:

Is this a regression? Does it depend on lua version?

Attachment: tutorial-turn-0.sav.gz
Description: GNU Zip compressed data

Freeciv-dev mailing list

Reply via email to