Andrettin / Wyrmsun

Strategy game based on history, mythology and fiction
http://andrettin.github.io/
GNU General Public License v2.0
301 stars 47 forks source link

'The Home of The Boii' quest is broken #99

Closed KroArtem closed 8 years ago

KroArtem commented 8 years ago

Attached a save game where Marbod was killed and the game continued. Probably that's why mission doesn't end.

game_marbod_must_survive.sav.gz

KroArtem commented 8 years ago

Moreover, when I try to quit this mission, I got a segfault:

COrder_Resource::ParseSpecificData() error: the unit type of Resource.Mine (ID 126) is NULL.
COrder_Resource::ParseSpecificData() error: the unit type of Resource.Mine (ID 126) is NULL.
COrder_Resource::ParseSpecificData() error: the unit type of Resource.Mine (ID 126) is NULL.
COrder_Resource::ParseSpecificData() error: the unit type of Resource.Mine (ID 126) is NULL.
COrder_Resource::ParseSpecificData() error: the unit type of Resource.Mine (ID 126) is NULL.
game ends

Thread 1 "stratagus-dbg" received signal SIGSEGV, Segmentation fault.
0x000000000069a0e3 in std::max<int> (__a=@0x7fffffffd680: 100, 
    __b=@0x8ac5804989c5ed99: <error reading variable>)
    at /usr/include/c++/5/bits/stl_algobase.h:224
224       if (__a < __b)
(gdb) bt
#0  0x000000000069a0e3 in std::max<int> (__a=@0x7fffffffd680: 100, 
    __b=@0x8ac5804989c5ed99: <error reading variable>)
    at /usr/include/c++/5/bits/stl_algobase.h:224
#1  0x00000000009c2c0f in RemoveUpgradeModifier (player=..., um=0x1592f010)
    at /home/kroartem/Wyrmgus/src/unit/upgrade.cpp:1645
#2  0x00000000009c4e06 in UpgradeLost (player=..., id=136)
    at /home/kroartem/Wyrmgus/src/unit/upgrade.cpp:2046
#3  0x000000000084ca53 in CPlayer::SetCivilization (this=0x19a24c0 <Players>, 
    civilization=6) at /home/kroartem/Wyrmgus/src/stratagus/player.cpp:1197
#4  0x000000000089e775 in CclSetPlayerData (l=0x1abdbc0)
    at /home/kroartem/Wyrmgus/src/stratagus/script_player.cpp:2837
#5  0x00007ffff7bb5320 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#6  0x00007ffff7bbfeea in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#7  0x00007ffff7bb577d in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#8  0x00007ffff7bb4a5e in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#9  0x00007ffff7bb58eb in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#10 0x00007ffff7bb13a8 in lua_pcall ()
   from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#11 0x000000000086f9a1 in LuaCall (narg=0, clear=1, exitOnError=true)
    at /home/kroartem/Wyrmgus/src/stratagus/script.cpp:185
#12 0x000000000086fd32 in LuaLoadFile (file="scripts/guichan.lua", strArg="")
    at /home/kroartem/Wyrmgus/src/stratagus/script.cpp:246
#13 0x00000000008deaa3 in MenuLoop ()
---Type <return> to continue, or q <return> to quit---
    at /home/kroartem/Wyrmgus/src/stratagus/stratagus.cpp:313
#14 0x00000000008df570 in stratagusMain (argc=1, argv=0x7fffffffdf48)
    at /home/kroartem/Wyrmgus/src/stratagus/stratagus.cpp:822
#15 0x0000000000846024 in main (argc=1, argv=0x7fffffffdf48)
    at /home/kroartem/Wyrmgus/src/stratagus/main.cpp:37
(gdb) 
Andrettin commented 8 years ago

Thank you! The issue was that now that the "CurrentQuest" is no longer a Lua global but a pointer in the engine's code, it was no longer being stored when saving a game. That's fixed now: https://github.com/Andrettin/Wyrmgus/commit/8395203165bcf8e9da52eca04165714996bdea96

About the crash when exiting, I haven't been able to find the reason for it so far.

KroArtem commented 8 years ago

The sad point is that quest doesn't finish with my savegame when I load it. :/

Andrettin commented 8 years ago

Here is a fixed version of your savegame :) https://dl.dropboxusercontent.com/u/1732902/Wyrmsun/game_marbod_must_survive.sav

KroArtem commented 8 years ago

Thanks. :)

KroArtem commented 8 years ago

I think this ticket can be closed. In case I have this segfault again, I'll open separate ticket.