To reproduce, I just created a new world with no mods. Create a PrecinctZ scenario with swat (so I’m in the city with armor). Its not 100% reproducible in the first city but eventually it will happen during map generation somewhere. Sometimes I don’t even get out of character generation as it is trying to resolve wrecks. Basically because it cannot properly find and destroy a car the wreck resolution keeps running repeatedly forever. If you do get through map gen then just run around the city blocks so that maps are created and its during dynamic road generation that it breaks. I was testing with code from SHA1 87093bf0ea982c4f92a5c4af0da28fedac3786bc which was yesterday about this time.
I get something like the below log which goes on until I kill the process. The zlevel is zero so its not exactly the same problem I guess but it does go on forever. I do have some customizations mostly around allocating tinymap on the heap rather than stack and some workarounds for compiling under VS 2015 and the mapsize constants so line numbers won’t align. I don’t believe either introduce substantive changes that would cause this problem. If I workaround the problem by returning a true/false if destroy works and then aborting then it will occasionally fail in some other way that I’ve been trying to track down (effectively vehicle_list becomes corrupt with deleted vehicles).
The code looks like it is trying to do the right thing generally so the problem is not obvious but if it does run into problems then it cannot recover due to the recursive nature of add_vehicle_to_map. At best it looks like some sort of cache/list mismatch. I’ll let you know if I find something. I’ll tested with the experimental builds and couldn’t reproduce so I suppose its possible that its compiler related.
13:17:57.499 ERROR : ..\src\map.cpp:6899 Tried to access invalid map position at grid (8,10,0)
13:17:57.500 ERROR : ..\src\map.cpp:333 destroy_vehicle can't find it! name=Mobile Meth Lab, submap:8,10,0
13:17:57.519 ERROR : ..\src\map.cpp:6899 Tried to access invalid map position at grid (8,10,0)
13:17:57.519 ERROR : ..\src\map.cpp:333 destroy_vehicle can't find it! name=Mobile Meth Lab, submap:8,10,0
Edit: I rolled back my changes except the ones needed to actually compile and it still happens. The problem seems to be related to vehicles spanning multiple submaps. When the x or y position is near 12 which is SEEX,SEEY and the vehicle is rotated then parts the car can span multiple submaps. The MethLab above is a large vehicle so its easier for it to span. So I suspect that there is some submap mapping mismatch or something going one.
Edit 2: Well guess it was one of my changes after all that i missed in rolling back which led to reuse of an already initialized value in the map. Sorry if you spent any time investigating.