]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
do not fail on missing image or model plugin, they can be optional 105/head
authorThomas Debesse <dev@illwieckz.net>
Sun, 28 Oct 2018 19:45:16 +0000 (20:45 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sun, 28 Oct 2018 20:18:32 +0000 (21:18 +0100)
libs/modulesystem/modulesmap.h

index a48a083b9798702bc89ee5f86c76af9c4347a9c3..fae4c2a67f5fa8f9bd52b713937a0219ec59aa43 100644 (file)
@@ -99,6 +99,7 @@ class ModulesRef
 ModulesMap<Type> m_modules;
 public:
 ModulesRef( const char* names ){
+       std::string type_name { typename Type::Name() };
        if ( !globalModuleServer().getError() ) {
                if ( string_equal( names, "*" ) ) {
                        InsertModules<Type> visitor( m_modules );
@@ -115,8 +116,14 @@ ModulesRef( const char* names ){
                                }
                                Module* module = globalModuleServer().findModule( typename Type::Name(), typename Type::Version(), name );
                                if ( module == 0 ) {
-                                       globalModuleServer().setError( true );
-                                       globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n";
+                                       // do not fail on missing image or model plugin, they can be optional
+                                       if ( type_name.compare("image") == 0 || type_name.compare("model") == 0 ) {
+                                               globalOutputStream() << "ModulesRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n";
+                                       }
+                                       else {
+                                               globalModuleServer().setError( true );
+                                               globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n";
+                                       }
                                        break;
                                }
                                else