From: Tim Goya Date: Mon, 19 Feb 2007 00:22:37 +0000 (+0000) Subject: Fix endsequence walking direction X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=fa4882876de63a2579e95530581d68def7ebf925;p=supertux.git Fix endsequence walking direction SVN-Revision: 4865 --- diff --git a/src/game_session.cpp b/src/game_session.cpp index 852d8f0ea..2abb68c5f 100644 --- a/src/game_session.cpp +++ b/src/game_session.cpp @@ -34,6 +34,7 @@ #include "game_session.hpp" #include "log.hpp" +#include "console.hpp" #include "worldmap/worldmap.hpp" #include "mainloop.hpp" #include "audio/sound_manager.hpp" @@ -586,7 +587,7 @@ GameSession::start_sequence(const std::string& sequencename) if (sequencename == "endsequence") { // Determine walking direction for Tux - float xst = 1.f, xend = 2.f; + /*float xst = 1.f, xend = 2.f; for(std::vector::iterator i = currentsector->gameobjects.begin(); i != currentsector->gameobjects.end(); i++) { SequenceTrigger* st = dynamic_cast(*i); if(!st) @@ -601,6 +602,11 @@ GameSession::start_sequence(const std::string& sequencename) end_sequence = new EndSequenceWalkLeft(); } else { end_sequence = new EndSequenceWalkRight(); + }*/ + if (currentsector->get_players()[0]->physic.get_velocity_x() < 0) { + end_sequence = new EndSequenceWalkLeft(); + } else { + end_sequence = new EndSequenceWalkRight(); } } else if (sequencename == "fireworks") end_sequence = new EndSequenceFireworks();