diff --git a/radiantcore/brush/BrushModule.cpp b/radiantcore/brush/BrushModule.cpp index 713f35575b..105870c473 100644 --- a/radiantcore/brush/BrushModule.cpp +++ b/radiantcore/brush/BrushModule.cpp @@ -11,6 +11,7 @@ #include "brush/BrushClipPlane.h" #include "brush/BrushVisit.h" #include "gamelib.h" +#include "selectionlib.h" #include "registry/registry.h" #include "ipreferencesystem.h" @@ -145,8 +146,11 @@ void BrushModuleImpl::registerBrushCommands() GlobalCommandSystem().addCommand("BrushMakeSided", selection::algorithm::brushMakeSided, { cmd::ARGTYPE_INT }); GlobalCommandSystem().addCommand("TextureNatural", selection::algorithm::naturalTexture); - GlobalCommandSystem().addCommand("MakeVisportal", selection::algorithm::makeVisportal); - GlobalCommandSystem().addCommand("SurroundWithMonsterclip", selection::algorithm::surroundWithMonsterclip); + GlobalCommandSystem().addWithCheck( + "MakeVisportal", [](const cmd::ArgumentList&) { selection::algorithm::makeVisportal(); }, + selection::pred::haveSelectedBrush + ); + GlobalCommandSystem().addCommand("SurroundWithMonsterclip", selection::algorithm::surroundWithMonsterclip); GlobalCommandSystem().addCommand("ResizeSelectedBrushesToBounds", selection::algorithm::resizeSelectedBrushesToBounds, { cmd::ARGTYPE_VECTOR3, cmd::ARGTYPE_VECTOR3, cmd::ARGTYPE_STRING }); diff --git a/radiantcore/selection/algorithm/Primitives.cpp b/radiantcore/selection/algorithm/Primitives.cpp index cbf3f975ca..f033568961 100644 --- a/radiantcore/selection/algorithm/Primitives.cpp +++ b/radiantcore/selection/algorithm/Primitives.cpp @@ -379,7 +379,7 @@ void createDecalsForSelectedFaces(const cmd::ArgumentList& args) } } -void makeVisportal(const cmd::ArgumentList& args) +void makeVisportal() { BrushPtrVector brushes = getSelectedBrushes(); diff --git a/radiantcore/selection/algorithm/Primitives.h b/radiantcore/selection/algorithm/Primitives.h index 8188c05876..9002bc893e 100644 --- a/radiantcore/selection/algorithm/Primitives.h +++ b/radiantcore/selection/algorithm/Primitives.h @@ -86,7 +86,7 @@ namespace selection { /** * greebo: Applies the visportal/nodraw texture combo to the selected brushes. */ - void makeVisportal(const cmd::ArgumentList& args); + void makeVisportal(); /** * greebo: Surrounds the current model selection with a monsterclip brush.