Skip to content

Commit

Permalink
fix #2452 (from github)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 6053f55d1d8ff1bc4e959ddd3030c6f5734affbd
  • Loading branch information
krasnotsvetov authored and intellij-monorepo-bot committed Jul 18, 2024
1 parent 1d7240b commit e9b339e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public long GetMinValue(IAttributeInstance attributeInstance)

public long GetMaxValue(IAttributeInstance attributeInstance)
{
var unityMaxValue = attributeInstance.PositionParameter(0);
return OdinCodeAnnotationUtil.GetMaxValue(unityMaxValue.ConstantValue);
return long.MaxValue;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ public bool IsApplicable(IAttributeInstance attributeInstance)
return false;

var unityMinValue = attributeInstance.PositionParameter(0);
var unityMaxValue = attributeInstance.PositionParameter(1);

if (!OdinCodeAnnotationUtil.IsApplicable(unityMinValue.ConstantValue))
return false;

if (!OdinCodeAnnotationUtil.IsApplicable(unityMaxValue.ConstantValue))
return false;

return true;
}
Expand All @@ -36,6 +40,7 @@ public long GetMinValue(IAttributeInstance attributeInstance)

public long GetMaxValue(IAttributeInstance attributeInstance)
{
return long.MaxValue;
var unityMinValue = attributeInstance.PositionParameter(1);
return OdinCodeAnnotationUtil.GetMaxValue(unityMinValue.ConstantValue);
}
}

0 comments on commit e9b339e

Please sign in to comment.