--- a/src/PhysicsObject.cc Sun Dec 07 00:46:04 2008 +0000
+++ b/src/PhysicsObject.cc Sun Dec 07 01:18:59 2008 +0000
@@ -348,15 +348,24 @@
}
void PhysicsObject::enable (void) {
+ // only enable once until disabled
+ if (alive)
+ return;
+
+ // mark as alive
alive = true;
+
+ // add the world objects list
world.addPhysicsObject(this);
}
void PhysicsObject::disable (void) {
+ // mark as disabled
alive = false;
}
void PhysicsObject::destroy (void) {
+ // mark as disabled and for deletion
alive = false;
shouldDelete = true;
}