From: Ingo Ruhnke Date: Sat, 6 Feb 2010 20:19:53 +0000 (+0000) Subject: Added missing variable initialisation and replaced some str != "" with !str.empty() X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=708e08f13639924ddee3a092dfeb1243975f2886;p=supertux.git Added missing variable initialisation and replaced some str != "" with !str.empty() SVN-Revision: 6305 --- diff --git a/src/trigger/door.cpp b/src/trigger/door.cpp index 56060d46d..85bf378fe 100644 --- a/src/trigger/door.cpp +++ b/src/trigger/door.cpp @@ -27,6 +27,7 @@ Door::Door(const Reader& reader) : state(CLOSED), target_sector(), target_spawnpoint(), + script(), sprite(), stay_open_timer() { @@ -48,6 +49,7 @@ Door::Door(int x, int y, std::string sector, std::string spawnpoint) : state(CLOSED), target_sector(), target_spawnpoint(), + script(), sprite(), stay_open_timer() { @@ -139,12 +141,12 @@ Door::collision(GameObject& other, const CollisionHit& hit) if (player) { state = CLOSING; sprite->set_action("closing", 1); - if(script != "") { + if(!script.empty()) { std::istringstream stream(script); Sector::current()->run_script(stream, "Door"); } - if(target_sector != "") { + if(!target_sector.empty()) { GameSession::current()->respawn(target_sector, target_spawnpoint); } }