From 81554dfdf10e5fed1b7a9d16472705df5ba5521a Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Sat, 8 Jun 2024 00:44:28 +1000 Subject: [PATCH] refactor(weapons): adjust jerry can weight and durability loss Resolves #1659. --- data/weapons.lua | 5 +++-- modules/inventory/server.lua | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/data/weapons.lua b/data/weapons.lua index 2ebed55ace..e56483c3bd 100644 --- a/data/weapons.lua +++ b/data/weapons.lua @@ -227,6 +227,7 @@ return { ['WEAPON_FIREEXTINGUISHER'] = { label = 'Fire Extinguisher', weight = 8616, + durability = 0.006 }, ['WEAPON_FIREWORK'] = { @@ -458,8 +459,8 @@ return { }, ['WEAPON_PETROLCAN'] = { - label = 'Gas Can', - weight = 12000, + label = 'Jerry Can', + weight = 4000, }, ['WEAPON_GADGETPISTOL'] = { diff --git a/modules/inventory/server.lua b/modules/inventory/server.lua index e83a59e353..23fba6c963 100644 --- a/modules/inventory/server.lua +++ b/modules/inventory/server.lua @@ -432,6 +432,10 @@ function Inventory.SlotWeight(item, slot, ignoreCount) end end + if item.hash == `WEAPON_PETROLCAN` then + weight += 15000 * (slot.metadata.ammo / 100) + end + if slot.metadata.components then for i = #slot.metadata.components, 1, -1 do local componentWeight = Items(slot.metadata.components[i])?.weight @@ -2538,6 +2542,10 @@ local function updateWeapon(source, action, value, slot, specialAmmo) weapon.metadata.durability = 0 end + if item.hash == `WEAPON_PETROLCAN` then + weapon.weight = Inventory.SlotWeight(item, weapon) + end + if action ~= 'throw' then inventory:syncSlotsWithPlayer({ { item = weapon }