diff --git a/src/xrGame/eatable_item.h b/src/xrGame/eatable_item.h index 666853f5c..81e86602f 100644 --- a/src/xrGame/eatable_item.h +++ b/src/xrGame/eatable_item.h @@ -47,7 +47,7 @@ class CEatableItem : public CInventoryItem { IC bool CanDelete() const { return m_bRemoveAfterUse == 1; }; IC bool CanConsumeCharge() const { return m_bConsumeChargeOnUse == 1; }; IC u8 GetMaxUses() { return m_iMaxUses; }; - IC u8 GetRemainingUses() const { return m_iPortionsMarker / m_eat_condition; }; + IC u8 GetRemainingUses() const { return (u8)roundf(((float)m_iMaxUses) * m_fCondition); }; IC void SetRemainingUses(u8 value) { m_fCondition = ((float)value / (float)m_iMaxUses); clamp(m_fCondition, 0.f, 1.f); }; DECLARE_SCRIPT_REGISTER_FUNCTION diff --git a/src/xrGame/script_zone.cpp b/src/xrGame/script_zone.cpp index 23bc7efeb..71973588e 100644 --- a/src/xrGame/script_zone.cpp +++ b/src/xrGame/script_zone.cpp @@ -92,7 +92,7 @@ void CScriptZone::net_Relcase (CObject *O) BOOL CScriptZone::feel_touch_contact (CObject* O) { - return (((CCF_Shape*)CFORM())->Contact(O)); + return (((CCF_Shape*)CFORM())->Contact(O)) != 0; } #ifdef DEBUG