Skip to content

Commit

Permalink
Fix #4500: You Can Reparent Primitives to any Entity, not just func_s…
Browse files Browse the repository at this point in the history
…tatics

This is now disallowed, it's required to have a func_static-like entity
selected as last item.
  • Loading branch information
codereader committed Mar 29, 2017
1 parent 35091a3 commit a9d0747
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions radiant/selection/algorithm/Group.cpp
Expand Up @@ -215,9 +215,17 @@ bool curSelectionIsSuitableForReparent()
return false;
}

Entity* entity = Node_getEntity(GlobalSelectionSystem().ultimateSelected());
scene::INodePtr lastSelected = GlobalSelectionSystem().ultimateSelected();
Entity* entity = Node_getEntity(lastSelected);

if (entity == NULL)
// Reject non-entities or models
if (entity == nullptr || entity->isModel())
{
return false;
}

// Accept only group nodes as parent
if (!Node_getGroupNode(lastSelected))
{
return false;
}
Expand All @@ -232,7 +240,7 @@ void parentSelection(const cmd::ArgumentList& args)
if (!curSelectionIsSuitableForReparent())
{
wxutil::Messagebox::ShowError(_("Cannot reparent primitives to entity. "
"Please select at least one brush/patch and exactly one entity."
"Please select at least one brush/patch and exactly one func_* entity. "
"(The entity has to be selected last.)"));
return;
}
Expand Down

0 comments on commit a9d0747

Please sign in to comment.