HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...
Bug #880895
Global variables with directions result in broken savegames
0%
Description
There is no find.direction()
function but if _freeciv_state_dump()
encounters a global variable with a direction object it puts assignment to it into savegames. Thus, loading the dump fails.
Related issues
History
#1
Updated by Alexandro Ignatiev almost 2 years ago
- Blocked by Bug #880869: Some bug with tolua-5.2 garbage collecting Direction objects added
#2
Updated by Alexandro Ignatiev almost 2 years ago
The solution can be making Direction
a normal object that has id, is found by find.direction and is clearly stringified. Patch attached (UPD: now, a working one).
#3
Updated by Alexandro Ignatiev almost 2 years ago
#4
Updated by Alexandro Ignatiev almost 2 years ago
And now, the correct patch here (apply over Bug #880869 patch I've posted before twice by accident). It resolves the savegame problem making Direction
a normal class, having properties, tostring and saving like any other userdata class of the game.
#5
Updated by Marko Lindqvist over 1 year ago
- File 0009-Make-Direction-a-normal-class.patch 0009-Make-Direction-a-normal-class.patch added
- Status changed from New to Resolved
- Rebased against current HEAD
- Minor style fixes
This should be fine for master (will push soon). Stable branches will need more thinking and work.
#6
Updated by Marko Lindqvist over 1 year ago
- Status changed from Resolved to In Progress
Master version now pushed.
Scripting API documentation in wiki has not yet been updated. I would appreciate if someone does it (I'll try to do it myself eventually if nobody else does).
#7
Updated by Alexandro Ignatiev over 1 year ago
Edited. But likely the help lied about DirObj:dir_ccw()
OO syntax - it's introduced only by this patch, it was direction.dir_ccw(DirObj)
before. Maybe need to fix it by backporting :)
#8
Updated by Marko Lindqvist over 1 year ago
- Sprint/Milestone changed from 2.6.3 to 2.6.4
#9
Updated by Marko Lindqvist about 1 year ago
- Sprint/Milestone changed from 2.6.4 to 2.6.5
#10
Updated by Marko Lindqvist 11 months ago
- Sprint/Milestone changed from 2.6.5 to 2.6.6
#11
Updated by Marko Lindqvist 6 months ago
- Sprint/Milestone changed from 2.6.6 to 3.0.1
#12
Updated by Marko Lindqvist 4 months ago
Marko Lindqvist wrote:
Stable branches will need more thinking and work.
Thats only S3_0 now that S2_6 is EOL. I think the solution there (without changing the lua API) is to update _freeciv_state_dump().
#13
Updated by Marko Lindqvist about 2 months ago
- File 0014-Don-t-try-to-save-lua-direction-objects-to-savegame.patch 0014-Don-t-try-to-save-lua-direction-objects-to-savegame.patch added
- Status changed from In Progress to Resolved
- Assignee set to Marko Lindqvist
Marko Lindqvist wrote:
Marko Lindqvist wrote:
Stable branches will need more thinking and work.
I think the solution there (without changing the lua API) is to update _freeciv_state_dump().
Patch attached. I don't think any code we could produce to the savegame would work (our API does not provide way to get name of the direction -> another ticket to open), so this simply skips direction objects. Better than crashing, at least.
Meant for S3_0 only.
#14
Updated by Marko Lindqvist about 2 months ago
Marko Lindqvist wrote:
Meant for S3_0 only.
Actually, will push also to S2_6, just in case.
#15
Updated by Marko Lindqvist about 1 month ago
Pushed to S3_0, not yet to S2_6.
#16
Updated by Marko Lindqvist about 1 month ago
- Status changed from Resolved to Closed
Now also in S2_6.