fix tux not dying when falling out of screen in invincible mode, fix bug when creatin...
authorMatthias Braun <matze@braunis.de>
Thu, 12 Jan 2006 16:41:13 +0000 (16:41 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 12 Jan 2006 16:41:13 +0000 (16:41 +0000)
SVN-Revision: 2989

src/object/player.cpp
src/object/player.hpp
src/worldmap.cpp

index 157cff1..002c422 100644 (file)
@@ -756,7 +756,7 @@ Player::kill(HurtMode mode)
     return;
 
   if(mode != KILL && 
-          safe_timer.get_timeleft() > 0 || invincible_timer.get_timeleft() > 0)
+          (safe_timer.get_timeleft() > 0 || invincible_timer.get_timeleft() > 0))
     return;                          
   
   sound_manager->play("sounds/hurt.wav");
@@ -790,6 +790,11 @@ Player::kill(HurtMode mode)
       dying = true;
       dying_timer.start(3.0);
       set_group(COLGROUP_DISABLED);
+
+      DisplayEffect* effect = new DisplayEffect();
+      effect->fade_out(3.0);
+      Sector::current()->add_object(effect);
+      sound_manager->stop_music(3.0);
     }
 }
 
index b247186..69396a7 100644 (file)
@@ -31,6 +31,7 @@
 #include "control/controller.hpp"
 #include "scripting/player.hpp"
 #include "player_status.hpp"
+#include "display_effect.hpp"
 
 class BadGuy;
 class Portable;
index 73a13b9..c4a5082 100644 (file)
@@ -1067,7 +1067,7 @@ WorldMap::savegame(const std::string& filename)
     return;
 
   std::string dir = FileSystem::dirname(filename);
-  if(PHYSFS_exists(dir.c_str()) == 0 && PHYSFS_mkdir(dir.c_str()) == 0) {
+  if(PHYSFS_exists(dir.c_str()) == 0 && PHYSFS_mkdir(dir.c_str()) != 0) {
     std::ostringstream msg;
     msg << "Couldn't create directory '" << dir << "' for savegame:"
         << PHYSFS_getLastError();