From 4e55c2158b5e9991b86d2377e37c373a3a433962 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 1 Dec 2004 23:26:31 +0000 Subject: [PATCH] fix secretarea and sequencetrigger loading bugs SVN-Revision: 2234 --- src/sector.cpp | 2 ++ src/trigger/secretarea_trigger.cpp | 10 ++++++---- src/trigger/secretarea_trigger.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/sector.cpp b/src/sector.cpp index 2a56628ce..00819823b 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -121,6 +121,8 @@ Sector::parse_object(const std::string& name, const lisp::Lisp& reader) return new Door(reader); } else if(name == "secretarea") { return new SecretAreaTrigger(reader); + } else if(name == "sequencetrigger") { + return new SequenceTrigger(reader); } else if(name == "platform") { return new Platform(reader); } else if(name == "jumpy" || name == "money") { diff --git a/src/trigger/secretarea_trigger.cpp b/src/trigger/secretarea_trigger.cpp index 53bbf8d0e..475103e60 100644 --- a/src/trigger/secretarea_trigger.cpp +++ b/src/trigger/secretarea_trigger.cpp @@ -12,16 +12,18 @@ SecretAreaTrigger::SecretAreaTrigger(const lisp::Lisp& reader) { reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); - bbox.set_size(32, 32); + float w = 32, h = 32; + reader.get("width", w); + reader.get("height", h); + bbox.set_size(w, h); reader.get("message", message); message_displayed = false; } -SecretAreaTrigger::SecretAreaTrigger(const Vector& pos) +SecretAreaTrigger::SecretAreaTrigger(const Rectangle& area) { - bbox.set_pos(pos); - bbox.set_size(32, 32); + bbox = area; message = "You found a secret area!"; message_displayed = false; } diff --git a/src/trigger/secretarea_trigger.h b/src/trigger/secretarea_trigger.h index 43b10a859..442b93d0c 100644 --- a/src/trigger/secretarea_trigger.h +++ b/src/trigger/secretarea_trigger.h @@ -12,7 +12,7 @@ class SecretAreaTrigger : public TriggerBase, public Serializable { public: SecretAreaTrigger(const lisp::Lisp& reader); - SecretAreaTrigger(const Vector& pos); + SecretAreaTrigger(const Rectangle& area); ~SecretAreaTrigger(); void write(lisp::Writer& writer); -- 2.11.0