From d8be908233fd7b85492d7a9e87f07bb207173990 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 25 Nov 2012 12:06:13 +0000 Subject: Moved core::EntityGlobe into a separate file, added various methods to core::Item and core::Slot, added r_slots cvar to draw entity slots and docks, added game methods for mounting and umounting of weapons, added playerlist to chat window. --- src/model/mapfile.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/model/mapfile.cc') diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc index fd82036..9badc9b 100644 --- a/src/model/mapfile.cc +++ b/src/model/mapfile.cc @@ -2045,11 +2045,25 @@ Model * MapFile::load(std::string const &name) model->set_origin(map_center * -1.0f); // translate transformed vertex groups + size_t frags = 0; for (Model::Groups::iterator git = model->groups().begin(); git != model->groups().end(); git++) { FragmentGroup *fragmentgroup = (*git); fragmentgroup->set_location(fragmentgroup->location() - map_center); + frags += fragmentgroup->size(); } + // set a sane radius if the mapfile is empty + if (frags == 0) { + const float r = SCALE; + model->model_box.assign( + math::Vector3f(-r, -r, -r), + math::Vector3f(r, r, r) + + ); + model->set_radius(model->box().max().length()); + } + + // translate tags for (Model::Lights::iterator lit = model->lights().begin(); lit != model->lights().end(); lit++) { (*lit)->get_location() -= map_center; @@ -2074,7 +2088,7 @@ Model * MapFile::load(std::string const &name) for (Model::Weapons::iterator wit = model->weapons().begin(); wit != model->weapons().end(); wit++) { (*wit)->get_location() -= map_center; } - + if (mapfile.warning_q2brush) con_warn << mapfile.name() << " quake2 style brushes detected" << std::endl; -- cgit v1.2.3