Disable acceleration in kill_fall().
[supertux.git] / src / object / hurting_platform.cpp
index c730e18..f03890c 100644 (file)
@@ -1,4 +1,4 @@
-//  $Id: hurtingplatform.cpp 3506 2006-05-12 01:41:09Z sommer $
+//  $Id$
 //
 //  SuperTux - Hurting Platform
 //  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
 #include "object_factory.hpp"
 
 HurtingPlatform::HurtingPlatform(const lisp::Lisp& reader)
-       : Platform(reader)
+        : Platform(reader)
 {
+  set_group(COLGROUP_TOUCHABLE);
 }
 
 HitResponse
-HurtingPlatform::collision(GameObject& other, const CollisionHit& hit)
+HurtingPlatform::collision(GameObject& other, const CollisionHit& )
 {
   Player* player = dynamic_cast<Player*>(&other);
   if (player) {
+    if(player->is_invincible()) {
+      return ABORT_MOVE;
+    }
     player->kill(false);
   }
   BadGuy* badguy = dynamic_cast<BadGuy*>(&other);
   if (badguy) {
     badguy->kill_fall();
   }
-  return Platform::collision(other, hit);
+
+  return FORCE_MOVE;
 }
 
 IMPLEMENT_FACTORY(HurtingPlatform, "hurting_platform");