X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject_factory.cpp;h=cc68005b7be01c3f9a5883cf7cfe9e21fd283654;hb=657fc40723665c04b3150946f5bd66b6b0af9230;hp=667a12f36ceaa3fb4e7fe22e5045508914860c69;hpb=1a36ad149a4ee89a601d523878d168ed3b68ae62;p=supertux.git diff --git a/src/object_factory.cpp b/src/object_factory.cpp index 667a12f36..cc68005b7 100644 --- a/src/object_factory.cpp +++ b/src/object_factory.cpp @@ -39,25 +39,13 @@ GameObject* create_object(const std::string& name, const lisp::Lisp& reader) return i->second->create_object(reader); } -GameObject* create_object(const std::string& name, const Vector& pos) +GameObject* create_object(const std::string& name, const Vector& pos, const Direction dir) { std::stringstream lisptext; lisptext << "((x " << pos.x << ")" - << " (y " << pos.y << "))"; - - lisp::Parser parser; - const lisp::Lisp* lisp = parser.parse(lisptext, "create_object"); - GameObject* object = create_object(name, *(lisp->get_car())); - - return object; -} - -GameObject* create_badguy_object(const std::string& name, const Vector& pos, const Direction dir) -{ - std::stringstream lisptext; - lisptext << "((x " << pos.x << ")" - << " (y " << pos.y << ")" - << " (direction " << dir << "))"; + << " (y " << pos.y << ")"; + if(dir != AUTO) + lisptext << " (direction " << dir << "))"; lisp::Parser parser; const lisp::Lisp* lisp = parser.parse(lisptext, "create_object");