From 708e08f13639924ddee3a092dfeb1243975f2886 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sat, 6 Feb 2010 20:19:53 +0000 Subject: [PATCH] Added missing variable initialisation and replaced some str != "" with !str.empty() SVN-Revision: 6305 --- 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