diff options
author | Stijn Buys <ingar@osirion.org> | 2012-12-01 10:18:16 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-12-01 10:18:16 +0000 |
commit | 1f1090ff36c05bd375c8fb1abf4624ec95232bd9 (patch) | |
tree | dbcb233971c78a116a2a22beb77f0ad76614b2b1 /src/model | |
parent | 85bbfb39bdc272614a2a1526c96f757cb58335d9 (diff) |
Import location_cannon tags from submodels, corrected a memleak while copying submodel docks and sounds.
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/mapfile.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc index 9badc9b..93d21ad 100644 --- a/src/model/mapfile.cc +++ b/src/model/mapfile.cc @@ -2022,13 +2022,25 @@ Model * MapFile::load(std::string const &name) for (Model::Sounds::const_iterator sit = submodel_model->sounds().begin(); sit != submodel_model->sounds().end(); sit++) { tag_sound = new Sound(*(*sit)); tag_sound->get_location().assign(tag_submodel->location() + tag_submodel->axis() * (tag_sound->location() - submodel_model->origin()) * tag_submodel->scale()); + model->add_sound(tag_sound); } // copy dock tags for (Model::Docks::const_iterator dit = submodel_model->docks().begin(); dit != submodel_model->docks().end(); dit++) { tag_dock = new Dock(*(*dit)); tag_dock->get_location().assign(tag_submodel->location() + tag_submodel->axis() * (tag_dock->location() - submodel_model->origin()) * tag_submodel->scale()); + model->add_dock(tag_dock); } + + // copy weapon tags + for (Model::Weapons::const_iterator wit = submodel_model->weapons().begin(); wit != submodel_model->weapons().begin(); wit++) { + tag_weapon = new Weapon(*(*wit)); + tag_weapon->get_location().assign(tag_submodel->location() + tag_submodel->axis() * (tag_weapon->location() - submodel_model->origin()) * tag_submodel->scale()); + tag_weapon->set_radius(tag_weapon->radius() * tag_submodel->scale()); + model->add_weapon(tag_weapon); + } + + } delete tag_submodel; |