Project Zomboid

Project Zomboid

[B41/B42] Item Condition
Hx Dec 27, 2024 @ 6:38am
2
B42 Bug Fix
2852309899\mods\qdx_item_condition\42\media\lua\client\qdx\item_condition\ItemConditionUtil.lua
function ItemCondition.Util:GetItemCondition(a_item) local condition = 0.0 if self:IsItemHandWeapon(a_item) then local percent = a_item:getCondition() / a_item:getConditionMax() condition = ItemCondition.Math:Clamp(percent, 0.0, 1.0) elseif self:IsItemWaterSource(a_item) then condition = ItemCondition.Math:Clamp(a_item:getUsedDelta(), 0.0, 1.0) end return condition end




↓ Change ↓

function ItemCondition.Util:GetItemCondition(a_item) local condition = 0.0 if self:IsItemHandWeapon(a_item) then local percent = a_item:getCondition() / a_item:getConditionMax() condition = ItemCondition.Math:Clamp(percent, 0.0, 1.0) elseif self:IsItemWaterSource(a_item) then condition = ItemCondition.Math:Clamp(a_item:getCurrentUsesFloat(), 0.0, 1.0) end return condition end



Fix Mod
https://steamcommunity.com/sharedfiles/filedetails/?id=3394609418
Last edited by Hx; Jan 15 @ 10:47pm
< >
Showing 1-4 of 4 comments
Sick Boy Dec 27, 2024 @ 11:40am 
Nice.

This works.
You're a genius bro. Thanks a lot !
ibu Jan 8 @ 9:08pm 
Thanks!
Choko Mar 18 @ 3:34pm 
This no longer works in the latest version.
< >
Showing 1-4 of 4 comments
Per page: 1530 50