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 over 1 year ago. Updated 5 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
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.

no-segfault-Direction-gc4.patch (9.6 KB) no-segfault-Direction-gc4.patch Alexandro Ignatiev, 2020-07-14 09:12 PM
no-segfault-Direction-gc4.patch (9.6 KB) no-segfault-Direction-gc4.patch Alexandro Ignatiev, 2020-07-14 09:14 PM
make-Direction-normal-object.patch (6.04 KB) make-Direction-normal-object.patch Alexandro Ignatiev, 2020-07-15 06:20 PM
0009-Make-Direction-a-normal-class.patch (6.11 KB) 0009-Make-Direction-a-normal-class.patch master Marko Lindqvist, 2020-10-08 04:38 AM

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 over 1 year ago

  • Blocked by Bug #880869: Some bug with tolua-5.2 garbage collecting Direction objects added

#2 Updated by Alexandro Ignatiev over 1 year 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 over 1 year 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 about 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 about 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 about 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 11 months ago

  • Sprint/Milestone changed from 2.6.3 to 2.6.4

#9 Updated by Marko Lindqvist 8 months ago

  • Sprint/Milestone changed from 2.6.4 to 2.6.5

#10 Updated by Marko Lindqvist 5 months ago

  • Sprint/Milestone changed from 2.6.5 to 2.6.6

Also available in: Atom PDF