Skip to content
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

Fix BaseMetaPipeEntity pass wrong side argument to 'onPlayerAttach' #3288

Merged

Conversation

reobf
Copy link
Contributor

@reobf reobf commented Sep 27, 2024

The argument passed to 'onPlayerAttach' is the clicked side('side'), not the wrenching side('coverSide'), 'onPlayerAttach' will receive wrong argument if attaching cover when sneaking.

This bug has no bad effects for now, because most 'onPlayerAttach' is a no-op for most covers.
And the only one CoverBehavour that overrides 'onPlayerAttach' is metrics cover, which is not allowed to be attched to BaseMetaPipeEntity.
But I think this will help if some CoverBehavour overrides onPlayerAttach in the future.

compare to BaseMetaTileEntity which is implemented correctly:

setCoverItemAtSide(coverSide, tCurrentItem);
coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, coverSide);

setCoverItemAtSide(coverSide, tCurrentItem);
coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, side);

@Dream-Master Dream-Master added the bug fix Fix a bug. Please link it in the PR. label Sep 27, 2024
@Dream-Master Dream-Master requested a review from a team September 27, 2024 02:31
@Dream-Master Dream-Master merged commit b6d5e9a into GTNewHorizons:master Sep 27, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Fix a bug. Please link it in the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants