New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item meta pointing range #14347
Item meta pointing range #14347
Conversation
@cx384 rebase needed |
Rebase done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. The telescope stick works as expected, the code looks good, I only have minor points.
Regarding your note, I think that it would most probably be cleaner to pass the item def manager. There is no performance concern here. That would allow us to get rid of one parameter. The call site would also be more readable: getToolRange(selected_item.getDefinition(m_itemdef), hand_item.getDefinition(m_itemdef), selected_item, hand_item)
would simplify to getToolRange(m_itemdef, hand_item, selected_item)
.
I applied your suggestions.
Now it gets an item def manager and All fields stored in MetaDataRef are just strings, so it doesn't matter how they are set, but I changed it for clarification. |
Indeed, in practice this isn't an issue. FYI there are some ugly details though (for example, your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm otherwise
Thanks for the review, I fixed everything and rebased. |
Goal of this PR
(The PR got a Concept approved label, but the issue not.)
How does it work
It uses the item meta key
range
to determine the pointing range.To do
This PR Ready for Review.
How to test
Start devtest, and left click with the
testitems:telescope_stick
to try out different ranges.