This one is a real doozy.
Here is the background. My collaborator is on Linux using GCC G++ as his compiler with C++11. I'm on OS X with Xcode 5, so my compiler is LLVM (which I understand to be clang++).
I have a vector of smart pointers to an object called GenericEnemy:
vector<unique_ptr<GenericEnemy> > enemies_;
Then during a game logic tick I iterate through each GenericEnemy, send a tick to it which checks if changeDirectionTimer_ has ticked. If so, select a new, random direction for the enemy:
movingDirection_ = (
SO, this all works fine and dandy on his computer. On mine, the timer ticks once as it should (a few seconds), and then suddenly it ticks every logic tick, as if e.type == ALLEGRO_EVENT_TIMER is ALWAYS true. I've even tried flushing the queue after every movingDirection_ update.
HERE is the really weird part. If I remove the use of smart pointers and do this:
Then everything works as it should on both OS's. Does anyone have ANY clue what could be causing this? We would realllllllly like to use smart pointers in this project.