diff options
Diffstat (limited to 'FileManager.cpp')
-rw-r--r-- | FileManager.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/FileManager.cpp b/FileManager.cpp index 89c6d41..90ef12b 100644 --- a/FileManager.cpp +++ b/FileManager.cpp @@ -282,10 +282,21 @@ bool FileManager::write() { return false; } - /*if(!writeStart(writer, window->getLevel().getPlayerStart())) { - xmlFreeTextWriter(writer); - return false; - }*/ + for(Level::iterator object = window->getLevel().begin(); ; object++) { + if(object == window->getLevel().end()) { + xmlFreeTextWriter(writer); + return false; + } + + if(!(*object)->isOfType("PlayerStart")) + continue; + + if(!writeStart(writer, *(PlayerStart*)&**object)) { + xmlFreeTextWriter(writer); + return false; + } + break; + } // </info> if(xmlTextWriterEndElement(writer) < 0) { |