Worm bin working with both worms and grubs

This commit is contained in:
2026-10-12 02:22:44 -03:00
parent ff5fb971da
commit df26248f4a
13 changed files with 222 additions and 60 deletions
+6
View File
@@ -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;
}