RosaryMala / armok-vision

A 3d realtime visualizer for Dwarf Fortress
MIT License
319 stars 27 forks source link

Index Array Out Of Range causing DFConnection.Start() to fail #25

Closed Shritish closed 8 years ago

Shritish commented 8 years ago

I haven't had much time to look into the exact reason, however:

PlantTokenList.cs line 73 is throwing an Array Index Out of Range for ColorTable on my system. (Called from InitStatics, I lost my debug information for the call stack, I could be bothered to get it if necessary)

If this happens, then DFConnection.Start() will never complete its call and you'll be left staring at a blank canvas because connectionManager will still be a null reference.

May I recommend some sanity checking coded within DFConnection.Update()? That or you could consider putting the connectionManager initialization into DFConnection.Awake() to ensure that it'll always be called separate from the code that could possibly cause an exception

RosaryMala commented 8 years ago

I made some fixes on the dfhack side (the color info was being translated wrongly)
But I'll add some sanity checking anyway.