From 2e827f45aa6f0366aed6e61d87d5dff0cecb585b Mon Sep 17 00:00:00 2001 From: grumbel Date: Sat, 6 Feb 2010 20:19:53 +0000 Subject: [PATCH] Added missing variable initialisation and replaced some str != "" with !str.empty() git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6305 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- src/trigger/door.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } } -- 2.11.0