MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 430 forks source link

leash upgrade result in infinite leash #3376

Open Water-Moon opened 3 years ago

Water-Moon commented 3 years ago

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:

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

asiekierka commented 2 years ago

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

asiekierka commented 2 years ago

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 commented 2 years ago

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.