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

leash upgrade result in infinite leash #3376

Open
Water-Moon opened this issue Nov 20, 2020 · 3 comments
Open

leash upgrade result in infinite leash #3376

Water-Moon opened this issue Nov 20, 2020 · 3 comments
Labels
bug OC feature is broken
Milestone

Comments

@Water-Moon
Copy link

Water-Moon commented Nov 20, 2020

One hour ago, in a forge-14.23.5.2847 server with OpenComputer 1.7.5.192, my friends and I decided to transport a few horses from a remote place to our home.
Since it's a long way, we decided to use a squad of drones. We wrote programs, placed down waypoints, and installed navigation upgrade + leash upgrade in all the drones. Then we started the drones. Everything was fine, and the horses were pulled into the air and being dragged toward our base.
And then, one of my friends got an idea: "Why don't we ride on those horses, so that we don't need to walk by ourselves?!"
We all thought that was a good idea, so we did it. However, just right after we got onto the horse, they(the horses) fell to the ground and broke the leash. However, what surprised us is that a leash item dropped to the ground. This made us think if there is a glitch. So we tried again, and that resulted in another leash item dropping out, without damaging the drone or the leash upgrade at all.
And that doesn't look right.
With that glitch, a player can just ride on a horse, then have a drone leash it, then move the drone high up and make the leash broke, and then move back down and repeat it. By doing that, we can get infinite leash.

We hope the leash upgrade could be re-implemented to solve this problem:

  • The leash upgrade now requires another call to a method that makes it take some leash item from the drone's internal storage, just like the generator upgrade.
  • when the leash method is called successfully, a leash is consumed
  • when the unleash method is called successfully, a leash is returned
  • in this way, if the leash broke, the program won't call the unleash method. Thus the leash won't be returned, and it won't dupe.

That's it. Also, thanks for the great mod! It was fun writing programs to solve 'real world' issues :)

@payonel payonel added the bug OC feature is broken label May 11, 2021
@asiekierka asiekierka added this to the OC 1.8.0 milestone Jun 8, 2022
@asiekierka
Copy link
Contributor

Simpler solution which doesn't break existing code: prevent entities from dropping the leash item if they're attached to a drone.

@asiekierka asiekierka self-assigned this Oct 2, 2022
@asiekierka
Copy link
Contributor

Experimental 1.7.10 fix available here https://asie.pl/files/OpenComputers-MC1.7.10-1.8.0-snapshot-20221002+9f1d521e4-universal.jar - please report back!

@asiekierka
Copy link
Contributor

The above fix doesn't work. What's worse, it's not a good idea - if the drone dies, the leash would still drop. Breaking existing code and consuming leashes is therefore necessary.

@asiekierka asiekierka added bug OC feature is broken and removed bug OC feature is broken labels Oct 9, 2022
@asiekierka asiekierka removed their assignment Oct 9, 2022
@asiekierka asiekierka modified the milestones: OC 1.8.0, OC 1.9.0 May 30, 2023
zeng-github01 added a commit to zeng-github01/OpenComputers that referenced this issue Apr 13, 2024
zeng-github01 added a commit to zeng-github01/OpenComputers that referenced this issue Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug OC feature is broken
Projects
None yet
Development

No branches or pull requests

3 participants