Project Zomboid

Project Zomboid

[B41/B42] Item Condition
Hx 27 Dec, 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://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3394609418
Last edited by Hx; 15 Jan @ 10:47pm
< >
Showing 1-4 of 4 comments
Sick Boy 27 Dec, 2024 @ 11:40am 
Nice.

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