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 incorrect fishing line offset with vanilla bobbers on modded rods. #4060

Merged
merged 5 commits into from
Feb 12, 2024

Conversation

RegularPhoenix
Copy link
Contributor

What is the bug?

[#3906]
Since the fishing line offset of modded rods was bound to bobbers, vanilla bobber accessories that replaced the original projectile of modded rods were causing incorrect offset.

Vanilla rods:
image

Modded rods:
image

Fixed modded rods:
image

How did you fix the bug?

Move ModifyFishingLine() hook to the ModItem class. This, alas, has no backward compatibility.

Are there alternatives to your fix?

Since vanilla bobber projectiles completely replace modded ones, there probably aren't any.
Additionally, ExampleFishingRod and ExampleBobber should also be updated.

@JavidPack JavidPack self-assigned this Feb 10, 2024
@JavidPack
Copy link
Collaborator

Looking go so far. We will want ExampleFishingRod and ExampleBobber fixed in this PR as well. Also, we want existing mod usage to continue working, so make sure the existing modprojectile hook is still being called, but mark it as [Obsolete("", error: true)] so that it must be fixed for the mod to be rebuilt.

You'll want to move ProjectileLoader.ModifyFishingLine to ItemLoader as well. (You'll be calling an Obsolete ProjectileLoader.ModifyFishingLine from ItemLoader.ModifyFishingLine to preserve existing functionality. )

Once that is done, I'll work on the tModPorter steps, I think we can do it with a HookRemoved entry. If you are adventurous and want to try doing the tModPorter and corresponding tests, you can, but it's a bit finnicky and I can do it when I merge this PR.

@RegularPhoenix
Copy link
Contributor Author

As a side note, since the line color is now depending on the rod, I suppose it will be more difficult to make different line colors on rods that fire multiple bobbers. At least I could not come up with any way, so I made the ExampleRod use a single color for now.

@JavidPack
Copy link
Collaborator

JavidPack commented Feb 12, 2024

Looks good. I made some more changes to add back in the original behavior. Thanks a lot for spearheading this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants