tlongstretch / freeserf-with-AI-plus

THIS PROJECT WAS MOVED TO 'Forkserf', GO THERE INSTEAD
https://github.com/forkserf/forkserf
GNU General Public License v3.0
1 stars 0 forks source link

Freeserf bug? - game crash during castle placement #38

Closed tlongstretch closed 3 years ago

tlongstretch commented 3 years ago

Sometimes the game crashes right at the beginning as the player castles are being built. It seems to happen much more often if you "touch" the game by moving around the map, resizing, switching players, etc. And if you don't touch anything it never crashes here it seems.

looking at it with VS debugger, I think it is trying to destroy the frame during the map-levelling function when placing the castle, and results in a direct3d error. I wonder if adding a mutex, pause, catch exception, something to avoid allowing the frame to be deleted while possibly still rendering it

image

tlongstretch commented 3 years ago

was able to reproduce same error repeatedly same way after a few tries

tlongstretch commented 3 years ago

I think I fixed this, with an ugly workaround. Now just telling the game to not mark these tiles as needing update when placing castles.

image

image