So I was working on code from day 34 and this happened:
1 2 3 4 5 6 7 8 9 10 11 | internal uint32 GetTileValue(world *World, tile_chunk *TileChunk, uint32 TestTileX, uint32 TestTileY) { uint32 TileChunkValue = 0; if(TileChunk) { uint32 TileChunkValue = GetTileValueUnchecked(World, TileChunk, TestTileX, TestTileY); } return(TileChunkValue); } |
See how I have 2 uint32 TileChunkValue definitions? TileChunkValue was 0 all the time because of that. Value from the GetTileValueUnchecked() call was completely ignored. And my tilemap was just empty.
Why C did that? And why compiler ignored that? (I have all same compiler keys as Casey had).
That's a shameful thing, but took me a long time to find it. Any ways to prevent that other than stepping through the code?