projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Separated EndSequence logic from GameSession. This will allow for nice hierarchy...
[supertux.git]
/
src
/
trigger
/
sequence_trigger.cpp
diff --git
a/src/trigger/sequence_trigger.cpp
b/src/trigger/sequence_trigger.cpp
index
7ef726d
..
5a94419
100644
(file)
--- a/
src/trigger/sequence_trigger.cpp
+++ b/
src/trigger/sequence_trigger.cpp
@@
-1,7
+1,7
@@
// $Id$
// $Id$
-//
+//
// SuperTux
// SuperTux
-// Copyright (C) 200
5
Matthias Braun <matze@braunis.de>
+// Copyright (C) 200
6
Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@
-12,11
+12,11
@@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
+
#include <config.h>
#include <config.h>
@@
-30,11
+30,12
@@
SequenceTrigger::SequenceTrigger(const lisp::Lisp& reader)
{
reader.get("x", bbox.p1.x);
reader.get("y", bbox.p1.y);
{
reader.get("x", bbox.p1.x);
reader.get("y", bbox.p1.y);
- float w
, h
;
+ float w
= 0, h = 0
;
reader.get("width", w);
reader.get("height", h);
bbox.set_size(w, h);
reader.get("sequence", sequence_name);
reader.get("width", w);
reader.get("height", h);
bbox.set_size(w, h);
reader.get("sequence", sequence_name);
+ triggerevent = EVENT_TOUCH;
}
SequenceTrigger::SequenceTrigger(const Vector& pos, const std::string& sequence)
}
SequenceTrigger::SequenceTrigger(const Vector& pos, const std::string& sequence)
@@
-64,10
+65,10
@@
SequenceTrigger::write(lisp::Writer& writer)
}
void
}
void
-SequenceTrigger::event(Player& , EventType type)
+SequenceTrigger::event(Player&
player
, EventType type)
{
if(type == triggerevent) {
{
if(type == triggerevent) {
-
GameSession::current()->start
_sequence(sequence_name);
+
player.trigger
_sequence(sequence_name);
}
}
}
}