rmtew / incursion-roguelike

The legendary computer game Incursion: Hall of the Goblin King!
https://incursion-roguelike.net/
Other
9 stars 1 forks source link

Uninitilized class variables #4

Open HexDecimal opened 3 months ago

HexDecimal commented 3 months ago

Visual Studio is throwing out a lot of C26495 warnings at the moment.

These are super easy to fix just by adding {} after the variable names, but if care is taken then initializers and other code can be simplified during this time depending on how the variables are actually set.

I might decide to focus on this just so that I can see the remaining warnings better.

rmtew commented 3 months ago

Personally I'd ignore all the warnings if it were me, but seems reasonable.

HexDecimal commented 3 months ago

So it turns out that the way Incursion loads data is to first load the data into uninitialized memory and then initialize the class on top of that memory afterwards. This of course causes any class initialization to clobber that data.

This wasn't nearly as easy as I though it was going to be. This will also affect the refactoring of the String and Array classes since they seem to have special code to handle loading state.