diff options
Diffstat (limited to 'src/model/model.cc')
-rw-r--r-- | src/model/model.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/model/model.cc b/src/model/model.cc index 3ec75d7..3ed5a93 100644 --- a/src/model/model.cc +++ b/src/model/model.cc @@ -5,6 +5,7 @@ */ #include "sys/sys.h" +#include "model/asefile.h" #include "model/model.h" #include "model/map.h" #include "model/vertexarray.h" @@ -101,10 +102,19 @@ Model *Model::load(std::string const & name) { Model *model = find(name); if (!model) { + // try loading the .map model model = Map::load(name); - if (model) { - model_registry[model->name()] = model; - } + } + + if (!model) { + // if it can't be found, try the ase model + model = ASEFile::load(name); + } + + if (!model) { + con_warn << "Could not load maps/" << name << ".map or models/" << name << ".ase" << std::endl; + } else { + model_registry[model->name()] = model; } return model; |