Powerup: Iceflower improvements
[supertux.git] / src / badguy / mole.cpp
index c9a40cd..46daf14 100644 (file)
@@ -76,6 +76,9 @@ Mole::collision_badguy(BadGuy& , const CollisionHit& )
 bool
 Mole::collision_squished(GameObject& )
 {
+  if (frozen)
+    return true;
+
   set_state(DEAD);
   sound_manager->play("sounds/squish.wav", get_pos());
   run_dead_script();
@@ -101,6 +104,9 @@ Mole::active_update(float elapsed_time)
 {
   BadGuy::active_update(elapsed_time);
 
+  if (frozen)
+    return;
+
   switch (state) {
     case PRE_THROWING:
       if (timer.check()) {
@@ -132,9 +138,18 @@ Mole::active_update(float elapsed_time)
 
 }
 
+bool
+Mole::is_freezable() const
+{
+  return true;
+}
+
 void
 Mole::set_state(MoleState new_state)
 {
+  if (frozen)
+    return;
+
   switch (new_state) {
     case PRE_THROWING:
       sprite->set_action("idle");