check for NULL
authornireco
Mon, 08 Dec 2008 16:38:33 +0000
changeset 292 d837bd7a0da3
parent 291 5d7221003b26
child 293 d40fbf8ba13b
check for NULL
src/Projectile.cc
--- a/src/Projectile.cc	Mon Dec 08 16:30:13 2008 +0000
+++ b/src/Projectile.cc	Mon Dec 08 16:38:33 2008 +0000
@@ -40,9 +40,9 @@
 }
 
 void Projectile::onCollision (Vector collisionPoint, PhysicsObject *other) {
-    (void) other;
+//    (void) other;
 
-    if(other->getType() == PLAYER) {
+    if(other != NULL && other->getType() == PLAYER) {
         Player* pl = dynamic_cast<Player*>(other);
         pl->takeDamage(12345);
     }