-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
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);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels