From 80b32f16d47db916bd78552bab5c935783eb57b5 Mon Sep 17 00:00:00 2001 From: Fernando Petroni Date: Tue, 17 Jan 2023 21:08:24 -0300 Subject: [PATCH] Make Game_Party.gainItem durability work Items gained via events and shops didn't come with durability set. --- RotomecaItemDurability.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/RotomecaItemDurability.js b/RotomecaItemDurability.js index 0c6ccec..13c62ad 100644 --- a/RotomecaItemDurability.js +++ b/RotomecaItemDurability.js @@ -498,22 +498,8 @@ Game_Party.prototype.gainItem = function (item, amount, includeEquip) { if (!!item && !!item.note && item.note.includes('')[0].replaceAll(' ', ''))).object(); - - alias_rotomeca_Game_Party_prototype_gainItem.call(this, item, 1, includeEquip); + newItem = Rotomeca.RotomecaItemDurability.createItemWithDurability(DataManager.isWeapon(item) ? 1 : 0, item, Number.POSITIVE_INFINITY); + alias_rotomeca_Game_Party_prototype_gainItem.call(this, newItem.object(), 1, includeEquip); } } else alias_rotomeca_Game_Party_prototype_gainItem.call(this, item, amount, includeEquip); @@ -747,4 +733,4 @@ BrokenIndicator.prototype._refresh = function () } else ++this._it; } -} \ No newline at end of file +}