* In the usage help, put LEVELFILE into brackets since it's an optional argument.
[supertux.git] / src / object / player.cpp
index e1f96b0..043a770 100644 (file)
@@ -38,6 +38,7 @@
 #include "object/camera.hpp"
 #include "object/gameobjs.hpp"
 #include "object/portable.hpp"
+#include "object/bullet.hpp"
 #include "trigger/trigger_base.hpp"
 #include "control/joystickkeyboardcontroller.hpp"
 #include "main.hpp"
@@ -153,6 +154,14 @@ Player::update(float elapsed_time)
     return;
   }
 
+  // fixes the "affected even while blinking" bug
+  if (safe_timer.started() && this->get_group() != COLGROUP_MOVING_ONLY_STATIC) {
+    this->set_group(COLGROUP_MOVING_ONLY_STATIC);
+  }
+  else if (!safe_timer.started() && this->get_group() == COLGROUP_MOVING_ONLY_STATIC) {
+    this->set_group(COLGROUP_MOVING);
+  }
+
   if(!controller->hold(Controller::ACTION) && grabbed_object) {
     // move the grabbed object a bit away from tux
     Vector pos = get_pos() + 
@@ -668,6 +677,11 @@ Player::collision_tile(uint32_t tile_attributes)
 HitResponse
 Player::collision(GameObject& other, const CollisionHit& hit)
 {
+  Bullet* bullet = dynamic_cast<Bullet*> (&other);
+  if(bullet) {
+    return FORCE_MOVE;
+  }
+
   Portable* portable = dynamic_cast<Portable*> (&other);
   if(portable && grabbed_object == 0 && controller->hold(Controller::ACTION)
      && fabsf(hit.normal.x) > .9) {