Project

Profile

Help

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

Added by Alexandro Ignatiev almost 2 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Category:
Scripting API
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

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

Blocked by Freeciv - Bug #880869: Some bug with tolua-5.2 garbage collecting Direction objectsClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

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).

#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

- 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 5 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 1 month ago

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 1 month 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.

Also available in: Atom PDF