From: Matthias Braun Date: Thu, 12 Jan 2006 16:41:13 +0000 (+0000) Subject: fix tux not dying when falling out of screen in invincible mode, fix bug when creatin... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=7526f143a40a5431cf3fa8010f1f2f25611523ea;p=supertux.git fix tux not dying when falling out of screen in invincible mode, fix bug when creating dirs for savegames SVN-Revision: 2989 --- diff --git a/src/object/player.cpp b/src/object/player.cpp index 157cff1fe..002c422fd 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -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); } } diff --git a/src/object/player.hpp b/src/object/player.hpp index b24718671..69396a737 100644 --- a/src/object/player.hpp +++ b/src/object/player.hpp @@ -31,6 +31,7 @@ #include "control/controller.hpp" #include "scripting/player.hpp" #include "player_status.hpp" +#include "display_effect.hpp" class BadGuy; class Portable; diff --git a/src/worldmap.cpp b/src/worldmap.cpp index 73a13b99e..c4a508230 100644 --- a/src/worldmap.cpp +++ b/src/worldmap.cpp @@ -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();