Open gnysek opened 3 years ago
Most of functions can be simplified, as argument_count isn't required anymore - default values can be set instead.
For example:
function pt_size() { var minSize = argument[0]; var maxSize = minSize; var inc = 0; var wiggle = 0; if (argument_count > 1) { maxSize = argument[1]; } if (argument_count > 2) { inc = argument[2]; } if (argument_count > 3) { wiggle = argument[3]; } part_type_size(global.__part_gen_type, argument[0], argument[1], inc, wiggle); }
Becomes
function pt_size(minSize = 0, maxSize = undefined, inc = 0, wiggle = 0) { if (is_undefined(maxSize) { maxSize = minSize; } part_type_size(global.__part_gen_type, minSize, maxSize, inc, wiggle); }
Yes, definitely. I've got a few things I'd like to overhaul in Particore and this is absolutely a part of that. Sorry for the late reply.
Most of functions can be simplified, as argument_count isn't required anymore - default values can be set instead.
For example:
Becomes