No more segfaults when trying to spawn bullets of unknown type
authorChristoph Sommer <mail@christoph-sommer.de>
Fri, 27 Jun 2008 15:45:33 +0000 (15:45 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Fri, 27 Jun 2008 15:45:33 +0000 (15:45 +0000)
SVN-Revision: 5635

src/object/bullet.cpp

index c761735..30e6dfa 100644 (file)
@@ -44,6 +44,10 @@ Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type)
   } else if(type == ICE_BONUS) {
     life_count = 10;
     sprite.reset(sprite_manager->create("images/objects/bullets/icebullet.sprite"));
+  } else {
+    log_warning << "Bullet::Bullet called with unknown BonusType" << std::endl;
+    life_count = 10;
+    sprite.reset(sprite_manager->create("images/objects/bullets/firebullet.sprite"));
   }
 
   bbox.set_pos(pos);