// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
+#include "trigger/door.hpp"
+
+#include <sstream>
+
#include "audio/sound_manager.hpp"
#include "object/player.hpp"
#include "sprite/sprite_manager.hpp"
#include "supertux/game_session.hpp"
#include "supertux/object_factory.hpp"
#include "supertux/sector.hpp"
-#include "trigger/door.hpp"
#include "util/reader.hpp"
Door::Door(const Reader& reader) :
state(CLOSED),
target_sector(),
target_spawnpoint(),
+ script(),
sprite(),
stay_open_timer()
{
state(CLOSED),
target_sector(),
target_spawnpoint(),
+ script(),
sprite(),
stay_open_timer()
{
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);
}
}