SDL: use hash table for color cache
[supertux.git] / src / badguy / kugelblitz.cpp
index f8ecf17..cbfdd99 100644 (file)
@@ -60,10 +60,10 @@ Kugelblitz::activate()
   dying = false;
 }
 
-HitResponse
-Kugelblitz::collision_solid(GameObject& , const CollisionHit& chit)
+void
+Kugelblitz::collision_solid(const CollisionHit& chit)
 {
-  return hit(chit);
+  hit(chit);
 }
 
 HitResponse
@@ -97,10 +97,10 @@ Kugelblitz::collision_badguy(BadGuy& other , const CollisionHit& chit)
 }
 
 HitResponse
-Kugelblitz::hit(const CollisionHit& chit)
+Kugelblitz::hit(const CollisionHit& hit)
 {
   // hit floor?
-  if(chit.normal.y < -.5) {
+  if(hit.bottom) {
     if (!groundhit_pos_set)
     {
       pos_groundhit = get_pos();
@@ -115,7 +115,7 @@ Kugelblitz::hit(const CollisionHit& chit)
     movement_timer.start(MOVETIME);
     lifetime.start(LIFETIME);
 
-  } else if(chit.normal.y < .5) { // bumped on roof
+  } else if(hit.top) { // bumped on roof
     physic.set_velocity_y(0);
   }
 
@@ -137,6 +137,7 @@ Kugelblitz::active_update(float elapsed_time)
         movement_timer.start(MOVETIME);
       }
     }
+    /*
     if (Sector::current()->solids->get_tile_at(get_pos())->getAttributes() == 16) {
       //HIT WATER
       Sector::current()->add_object(new Electrifier(75,1421,1.5));
@@ -147,8 +148,9 @@ Kugelblitz::active_update(float elapsed_time)
       //HIT ELECTRIFIED WATER
       explode();
     }
+    */
   }
-  BadGuy::active_update(elapsed_time);  
+  BadGuy::active_update(elapsed_time);
 }
 
 void
@@ -161,7 +163,7 @@ Kugelblitz::explode()
 {
   if (!dying) {
     sprite->set_action("pop");
-    lifetime.start(0.2);
+    lifetime.start(0.2f);
     dying = true;
   }
   else remove_me();