MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / checkPatchDimension

Function checkPatchDimension

radiantcore/patch/algorithm/Prefab.cpp:188–198  ·  view source on GitHub ↗

Sanitise the integer to specify a valid patch dimension will return 0 if the input is invalid

Source from the content-addressed store, hash-verified

186// Sanitise the integer to specify a valid patch dimension
187// will return 0 if the input is invalid
188std::size_t checkPatchDimension(int input)
189{
190 // Must be an odd number in [3..15]
191 if (input < 3 || input > 15 || input % 2 == 0)
192 {
193 return 0;
194 }
195
196 // all good
197 return static_cast<std::size_t>(input);
198}
199
200void createSimplePatch(const cmd::ArgumentList& args)
201{

Callers 1

createSimplePatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected