Revert "Proposed fix for coverity #29372" because of causing Segmentation
[supertux.git] / src / scripting / scripting.cpp
index b19c13b..1e27640 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#include "physfs/buffered_ifile_stream.hpp"
+#include "physfs/ifile_stream.hpp"
 #include "scripting/squirrel_error.hpp"
 #include "scripting/wrapper.hpp"
 #include "squirrel_util.hpp"
@@ -106,9 +106,8 @@ Scripting::Scripting(bool enable_debugger)
   // try to load default script
   try {
     std::string filename = "scripts/default.nut";
-    BufferedIFileStream* buffered_stream = new BufferedIFileStream(filename);
-    IFileStream* stream = buffered_stream->get_stream();
-    scripting::compile_and_run(global_vm, *stream, filename);
+    IFileStream stream(filename);
+    scripting::compile_and_run(global_vm, stream, filename);
   } catch(std::exception& e) {
     log_warning << "Couldn't load default.nut: " << e.what() << std::endl;
   }