Epic failures in the game development field.

This blog covers funny/weird issues and bugs from games that happened during development.

Send your own contributions to igetyourfail at repi.se (can be anonymous if specified)

Tuesday, January 5, 2010

Efficient spawn table creation using STL

std::vector<vector3> spawn_table;

for( int i=0; i<level.getSpawnCount(); ++i )
spawn_table.push_back( *( new vector3() ) );

spawn_table.back() = level.getSpawn( i );

(Thanks Julien)


NeARAZ said...

Also quite efficient at leaking memory!

repi said...

What are you saying? Isn't process memory an infinite resource?!

h3r3tic said...

*Jedi mind trick* The garbage collector will handle that.

NeARAZ said...

@repi: they said a Turing machine has infinite memory!

kotowate said...

Oh, I know that, used many times. Memory shredding algorithm. Shreds memory and leaves holes.