Worm bin working with both worms and grubs
This commit is contained in:
@@ -1154,6 +1154,12 @@ function menu_slot(
|
||||
if (options.output_only) added.output = true;
|
||||
if (on_take) added.on_take = (item) => guarded("an on_take", () => on_take(item_api(item))) === true;
|
||||
if (options.icon) added.icon = String(options.icon);
|
||||
if (options.max_count !== undefined) {
|
||||
if (!Number.isInteger(options.max_count) || options.max_count < 1) {
|
||||
throw new Error(`slot ${slot}'s max_count must be a whole number, at least 1`);
|
||||
}
|
||||
added.max_count = options.max_count;
|
||||
}
|
||||
if (engine === player.inventory) added.inventory = slot;
|
||||
return added;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user