Skip to content

Commit

Permalink
Fixed regression for Attr/CanUse checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbnolok committed Jun 14, 2024
1 parent 945ce47 commit 8e44484
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/game/items/CItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,29 +627,34 @@ class CItem : public CObjBase
*/
HUE_TYPE GetHueVisible() const;

void SetAttr(uint64 uiAttr)
void SetAttr(uint64 uiAttr) noexcept
{
m_Attr |= uiAttr;
}
void ClrAttr(uint64 uiAttr)
void ClrAttr(uint64 uiAttr) noexcept
{
m_Attr &= ~uiAttr;
}
bool IsAttr(uint64 uiAttr) const // ATTR_DECAY
bool IsAttr(uint64 uiAttr) const noexcept
{
return ((m_Attr & uiAttr) == uiAttr);
// true even if only one flag among those passed is present
return (m_Attr & uiAttr);
}
void SetCanUse(uint64 uiCanUse)
void SetCanUse(uint64 uiCanUse) noexcept
{
m_CanUse |= uiCanUse;
}
void ClrCanUse(uint64 uiCanUse)
void ClrCanUse(uint64 uiCanUse) noexcept
{
m_CanUse &= ~uiCanUse;
}
bool IsCanUse(uint64 uiCanUse) const // CanUse_None
bool IsCanUse(uint64 uiCanUse) const noexcept
{
return ((m_CanUse & uiCanUse) == uiCanUse);
// true even if only one flag among those passed is present
return (m_CanUse & uiCanUse);

// true only if m_CanUse has every one of the passed flags.
//return ((m_CanUse & uiCanUse) == uiCanUse);
}

height_t GetHeight() const;
Expand Down

0 comments on commit 8e44484

Please sign in to comment.