grannypron / uaf

GNU General Public License v2.0
21 stars 6 forks source link

Saving in an Camp event that is in a Step event causes "Illegal game state for save" #27

Open grannypron opened 3 years ago

grannypron commented 3 years ago

When the player attempts to save in a Camp event that is placed in a step event, they get the message "Illegal game state for save". It does seem like the game is saved, but when the game is loaded the message "0x000ab4e5 is popped up and the game crashes.

The attached design is an example and the camp event is triggered in zone 3, which is only on square 6,6.

grannypron commented 3 years ago

uaf_00027.dsn.zip

grannypron commented 3 years ago

Stack trace of the error looks like:

UAFWin.exe!GameEvent::SaveGame() Line 1091
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\RunEvent.cpp(1091)
UAFWin.exe!SAVEGAME_MENU_DATA::OnKeypress(key_code key, char ascii) Line 5528
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\RunEvent.cpp(5528)
UAFWin.exe!TASKLIST::OnKeypress(KEY_DATA & kd) Line 836
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\CProcinp.cpp(836)
UAFWin.exe!CProcessInput::ProcessInput(HWND__ * hwnd) Line 1150
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\CProcinp.cpp(1150)
UAFWin.exe!scheduler() Line 1541
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\Dgngame.cpp(1541)
UAFWin.exe!INPUTQUEUE::DistributeInput() Line 2229
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\CProcinp.cpp(2229)
UAFWin.exe!CDungeonApp::Run() Line 386
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\Dungeon.cpp(386)
UAFWin.exe!AfxWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 47
    at d:\agent\_work\3\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\winmain.cpp(47)
UAFWin.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 26
    at d:\agent\_work\3\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\appmodul.cpp(26)
UAFWin.exe!invoke_main() Line 107
    at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(107)

But right before that, the following stack happens, which seems to be the correct path for saving the game:

UAFWin.exe!ENCAMP_MENU_DATA::OnSaveGame(unsigned int * saveArea) Line 9346
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\RunEvent.cpp(9346)
UAFWin.exe!TASKLIST::SaveTaskStack() Line 992
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\CProcinp.cpp(992)
UAFWin.exe!GameEvent::SaveGame() Line 1091
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\RunEvent.cpp(1091)
UAFWin.exe!SAVEGAME_MENU_DATA::OnKeypress(key_code key, char ascii) Line 5528
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\RunEvent.cpp(5528)
UAFWin.exe!TASKLIST::OnKeypress(KEY_DATA & kd) Line 836
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\CProcinp.cpp(836)
UAFWin.exe!CProcessInput::ProcessInput(HWND__ * hwnd) Line 1150
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\CProcinp.cpp(1150)
UAFWin.exe!scheduler() Line 1541
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\Dgngame.cpp(1541)
UAFWin.exe!INPUTQUEUE::DistributeInput() Line 2229
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\CProcinp.cpp(2229)
UAFWin.exe!CDungeonApp::Run() Line 386
    at C:\Users\Shadow\Desktop\uaf.git\uaf-master\src\UAFWin\Dungeon.cpp(386)
UAFWin.exe!AfxWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 47
    at d:\agent\_work\3\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\winmain.cpp(47)
UAFWin.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 26
    at d:\agent\_work\3\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\appmodul.cpp(26)
UAFWin.exe!invoke_main() Line 107
    at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(107)
grannypron commented 3 years ago

Actually seems to be more about saving in a square zoned WITHOUT the "Can't Rest in this Zone" box checked. See uaf_levels#32