Game Development Community

Minor bug list

by Gerald Fishel · in Torque Game Engine Advanced · 05/27/2009 (6:00 am) · 0 replies

I'm porting an editor app and going through a bunch of stuff that I had previously gone through as far as finding little bugs, so I'll start posting them as I come across them here. Starting this thread now so I don't forget :p I'm not going to scan the known bug lists for each one, so sorry if some have already been mentioned.

#1)
In WorldEditor::copySelection(Selection & sel), the object(s) selected are written to a set of memory streams that are never terminated with a NULL. Now if you look in WorldEditor::pasteSelection, you will see that it's just grabbing the raw data pointer from the memory streams and evaluating them. So it tries to execute a bunch of garbage at the end, and in some rare cases that memory can include some other arbitrary script that may be executed and really hose things.

The solution is to add the following:
stream.write( 1, "x0" );

after this line:
sel[i]->write(stream, 0);




#2)
In Material::Material, mScrollDir and mScrollSpeed are not initialized.

Add the following:
dMemset( mScrollDir, 0, sizeof( mScrollDir ) );
   dMemset( mScrollSpeed, 0, sizeof( mScrollSpeed ) );



Actually it looks like that's all for now. Most of the rest are not really bugs per se, but just really bad ideas that made it impossible to get back to a clean slate without restarting the process; global and static objects all over the place, classes defined in .cpp files making them inaccessible from anywhere else, and such. My favorites were the function-level static string table entries, which would never get re-initialized after resetting the string tables. Those were fun to track down :p