Merge lp://staging/~widelands-dev/widelands/lua_mapview_persistence into lp://staging/widelands
Proposed by
cghislai
Status: | Merged | ||||
---|---|---|---|---|---|
Merge reported by: | SirVer | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp://staging/~widelands-dev/widelands/lua_mapview_persistence | ||||
Merge into: | lp://staging/widelands | ||||
Diff against target: |
438 lines (+25/-156) 7 files modified
src/game_io/game_interactive_player_data_packet.cc (+0/-114) src/game_io/game_interactive_player_data_packet.h (+0/-38) src/game_io/game_loader.cc (+2/-2) src/game_io/game_saver.cc (+2/-2) src/scripting/lua_ui.cc (+7/-0) src/scripting/lua_ui.h (+3/-0) test/lua/persistence.wmf/scripting/init.lua (+11/-0) |
||||
To merge this branch: | bzr merge lp://staging/~widelands-dev/widelands/lua_mapview_persistence | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SirVer | Approve | ||
Review via email: mp+177251@code.staging.launchpad.net |
Description of the change
This is first attempt to persist the mapview. I thought that census and statistics test failed, but after merging trunk and testing again the test seems to pass now - I have no idea why.
I also tried to reproduce the bug as explained in the report, and could not trigger the crash, even on empire 2.
To post a comment you must log in.
I think this is the wrong approach - the LuaClass does not have any data members, so it should not persist anything at all. The MapView (c++ class) should save its data to save games one day, so that you have the same view and so on when loading.
For the Lua fix here, all clases that can get a handle again on the c++ class on a reaload should overwrite the __persists methods which basically does nothing.
The logic here is: if you have a handle to a Window (e.g. a building window of any building) in a lua variable and the game is saved what should the window persist? It cannot reopen the window again after reload (since there is no open_window(name) method), the reloaded game will not have opened the window too, so the variable would contain crap after reloading. For the MapView this is not true: you can always get a hold on the map view again, because there is always a singular one available.
mmh, I fear this was not very well explained. Do you still get what I mean?