At 8/29/09 05:14 PM, citricsquid wrote:
At 8/29/09 04:21 PM, Johnny wrote:
/facepalm
My favourite programming fuck up is mixing up = and ==, has some funky results.
My least favorite programming error I've encountered, in c++, has to be when using the container class std::map. Iterators to it are supposed to remain valid if something else is deleted out of it, and indeed with GCC their implementation is correct. But, not with microsoft's compiler! So I can't pop through the map and delete unnecessary items, and all the segfaults and overwrites were crashing the game on windows. So I had to make a new map, copy the valid items over, delete the old map, and set the old map to a new map to delete a few items out of it conditionally. What a pain. Took forever to track down, took forever to fix.
Also recently I found out that when you open a file for loading, it defaults to text mode. Text mode converts some byte patterns to other things (line breaks are funky) depending on the OS, and naturally it loads stuff the right way otherwise. So my game had a few levels which it would just die trying to load on windows, so I had this huge workaround thing trying to figure out why my code wasn't working, and I got it to work 95% of the time, till i found the reason was just i needed to pop | std::ios::binary when opening a file. Then BAM all my problems for the last 2 months were solved.
You guys and your flash have it easy.