@@ -16,15 +16,15 @@ ParticlesDefinitions::~ParticlesDefinitions() {
1616 vm->clearReferences (Daedalus::IC_Pfx);
1717 }
1818
19- const ParticleFx* ParticlesDefinitions::get (std::string_view name) {
19+ const ParticleFx* ParticlesDefinitions::get (std::string_view name, bool relaxed ) {
2020 if (name.empty ())
2121 return nullptr ;
2222
2323 while (FileExt::hasExt (name," PFX" ))
2424 name = name.substr (0 ,name.size ()-4 );
2525
2626 std::lock_guard<std::recursive_mutex> guard (sync);
27- return implGet (name);
27+ return implGet (name,relaxed );
2828 }
2929
3030const ParticleFx* ParticlesDefinitions::get (const ParticleFx* base, const VisualFx::Key* key) {
@@ -34,13 +34,13 @@ const ParticleFx* ParticlesDefinitions::get(const ParticleFx* base, const Visual
3434 return implGet (*base,*key);
3535 }
3636
37- const ParticleFx* ParticlesDefinitions::implGet (std::string_view name) {
37+ const ParticleFx* ParticlesDefinitions::implGet (std::string_view name, bool relaxed ) {
3838 auto cname = std::string (name);
3939 auto it = pfx.find (cname);
4040 if (it!=pfx.end ())
4141 return it->second .get ();
4242 Daedalus::GEngineClasses::C_ParticleFX decl={};
43- if (!implGet (name,decl))
43+ if (!implGet (name,decl,relaxed ))
4444 return nullptr ;
4545 std::unique_ptr<ParticleFx> p{new ParticleFx (decl,name)};
4646 auto elt = pfx.insert (std::make_pair (std::move (cname),std::move (p)));
@@ -60,15 +60,17 @@ const ParticleFx* ParticlesDefinitions::implGet(const ParticleFx& base, const Vi
6060 }
6161
6262bool ParticlesDefinitions::implGet (std::string_view name,
63- Daedalus::GEngineClasses::C_ParticleFX& ret) {
63+ Daedalus::GEngineClasses::C_ParticleFX& ret,
64+ bool relaxed) {
6465 if (!vm || name.empty ())
6566 return false ;
6667
6768 char buf[256 ] = {};
6869 std::snprintf (buf,sizeof (buf)," %.*s" ,int (name.size ()),name.data ());
6970 auto id = vm->getDATFile ().getSymbolIndexByName (buf);
7071 if (id==size_t (-1 )) {
71- Log::e (" invalid particle system: \" " ,buf," \" " );
72+ if (!relaxed)
73+ Log::e (" invalid particle system: \" " ,buf," \" " );
7274 return false ;
7375 }
7476
0 commit comments