Select WMOs during drag selection
This commit is contained in:
2
src/external/blizzard-archive-library
vendored
2
src/external/blizzard-archive-library
vendored
Submodule src/external/blizzard-archive-library updated: c3958b6f95...9990612b67
@@ -3004,7 +3004,8 @@ void World::select_objects_in_area(
|
|||||||
|
|
||||||
for (auto& pair : tile->getObjectInstances())
|
for (auto& pair : tile->getObjectInstances())
|
||||||
{
|
{
|
||||||
if (pair.second[0]->which() == eMODEL)
|
auto objectType = pair.second[0]->which();
|
||||||
|
if (objectType == eMODEL || objectType == eWMO)
|
||||||
{
|
{
|
||||||
for (auto& instance : pair.second)
|
for (auto& instance : pair.second)
|
||||||
{
|
{
|
||||||
@@ -3031,6 +3032,18 @@ void World::select_objects_in_area(
|
|||||||
auto modelInstance = _model_instance_storage.get_instance(uid);
|
auto modelInstance = _model_instance_storage.get_instance(uid);
|
||||||
if (modelInstance && modelInstance.value().index() == eEntry_Object) {
|
if (modelInstance && modelInstance.value().index() == eEntry_Object) {
|
||||||
auto obj = std::get<selected_object_type>(modelInstance.value());
|
auto obj = std::get<selected_object_type>(modelInstance.value());
|
||||||
|
auto which = std::get<selected_object_type>(modelInstance.value())->which();
|
||||||
|
if (which == eWMO)
|
||||||
|
{
|
||||||
|
auto model_instance = static_cast<WMOInstance*>(obj);
|
||||||
|
|
||||||
|
if (!is_selected(obj) && !model_instance->wmo->is_hidden())
|
||||||
|
{
|
||||||
|
this->add_to_selection(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (which == eMODEL)
|
||||||
|
{
|
||||||
auto model_instance = static_cast<ModelInstance*>(obj);
|
auto model_instance = static_cast<ModelInstance*>(obj);
|
||||||
|
|
||||||
if (!is_selected(obj) && !model_instance->model->is_hidden())
|
if (!is_selected(obj) && !model_instance->model->is_hidden())
|
||||||
@@ -3044,4 +3057,5 @@ void World::select_objects_in_area(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user