freeserf.net icon indicating copy to clipboard operation
freeserf.net copied to clipboard

Crash

Open athach opened this issue 2 years ago • 10 comments

Hi, The game crashed for the first time after many hours of play time. There may have been a fight going on, There was no error message. Is there any log file and/or auto save file?

athach avatar Feb 11 '22 19:02 athach

I believe I was scrolling when it happened.

athach avatar Feb 11 '22 19:02 athach

I dont know if it is the same crash but the attached save game crashes after about 35 seconds on maximum speed. quicksave-12-02-22-13-00-08.zip .

athach avatar Feb 12 '22 12:02 athach

Thank you for all your reportings. At the moment my time is very limited and I work on several other projects, but I will have a look at it when I have some time on hand.

Pyrdacor avatar Feb 12 '22 20:02 Pyrdacor

No problem. I understand your situation. Thank you very much for the excellent work on this clone! The game is very much playable and I enjoy it a lot.

athach avatar Feb 13 '22 17:02 athach

I got a new crash in a new game. I got the feeling that this is directly or indirectly related to fights.

athach avatar Feb 13 '22 17:02 athach

This game crashes after a few seconds on maximum speed quicksave-13-02-22-18-53-09.zip .

athach avatar Feb 13 '22 17:02 athach

After the first crash ("Not reached") there is a second different crash ("Not inventory").

For the first crash maybe this is missing in HandleSerfEnteringBuildingState() in serf.cs at line 5702 case Building.Type.Castle: nextState = State.DefendingCastle; break;

athach avatar Feb 13 '22 18:02 athach

The second crash happens when a pig transportation is aborted due to road demolition caused by enemy occupying a building. The pig is going to the castle but the castled is not marked as having an inventory, it stocks fish. edited

athach avatar Feb 13 '22 20:02 athach

I believe I found the root cause of the two crashes mentioned just above (but not the original crash of this thread). Building.KnightRequestGranted() is called for castles and thereby destroys the castle inventory flag (stock[0].requested=0xff).

If you want I will try to create a pull request with a fix. I am new to GitHub but have used git locally.

athach avatar Feb 14 '22 20:02 athach

Regarding the first crash of this thread. Somehow player1.castle.firstknight=0. Serf 0 belongs to player 0 and is of type none. I guess somehow firstknight got corrupt somewhere, I will do some digging.

athach avatar Feb 17 '22 11:02 athach