diff --git a/particles.cpp b/particles.cpp index 361f2b8c..58bc2f22 100644 --- a/particles.cpp +++ b/particles.cpp @@ -474,7 +474,10 @@ particle_manager::find( std::string const &Template ) { } // ... and if it fails try to add the template to the database from a data file smoke_source source; - if( source.deserialize( cParser( templatepath + templatename + ".txt", cParser::buffer_FILE ) ) ) { + cParser parser(templatepath + templatename + ".txt", cParser::buffer_FILE); + + if (source.deserialize(parser)) + { // if deserialization didn't fail finish source setup... source.m_opacitymodifier.bind( &Global.SmokeFidelity ); // ...then cache the source as template for future instances