Merge pull request #193 from Crowns3bc/Allow-a-quantity-of-items-to-drop-from-chests

Allow a quantity of items to drop from chests
This commit is contained in:
Kaan Soral
2025-10-03 20:06:59 +03:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1903,13 +1903,13 @@ function drop_item_logic(drop, def, pvp) {
} else if (def[1] == "open") { } else if (def[1] == "open") {
chest_exchange(drop, def[2]); chest_exchange(drop, def[2]);
} else { } else {
var item = create_new_item(def[1]); var item = create_new_item(def[1], def[2]);
if (pvp) { if (pvp) {
item.v = new Date(); item.v = new Date();
} }
for (var i = 0; i < drop.items.length; i++) { for (var i = 0; i < drop.items.length; i++) {
if (can_stack(drop.items[i], item)) { if (can_stack(drop.items[i], item)) {
drop.items[i].q += 1; drop.items[i].q += def[2] ?? 1;
added = true; added = true;
break; break;
} }
+1 -1
View File
@@ -3566,7 +3566,7 @@ function chest_exchange(chest, name) {
} else if (drop[1] == "open") { } else if (drop[1] == "open") {
chest_exchange(chest, drop[2]); chest_exchange(chest, drop[2]);
} else { } else {
chest.items.push(create_new_item(drop[1])); chest.items.push(create_new_item(drop[1], drop[2]));
} }
} }
}); });