leafreynolds / cosmere

Bringing The Cosmere to Minecraft!
MIT License
25 stars 19 forks source link

[Allomancy] Iron/Steel push and pull list is not always clearing on key release #48

Open R0b0r0b opened 9 months ago

R0b0r0b commented 9 months ago

Issue description

Sometimes (well, fairly often) Pushing on a coin will cause you to continuously Push on it even when you let go of the Push keybind. The only way to resolve this is to stop burning steel and pick up the coin, or to switch dimensions. It's especially annoying because, in past versions of the mod, you could stop burning, then start again and it would 'reset' the Pushing so you'd no longer be pushing on it. Now, if you resume burning steel, you will start continuously Pushing on it again.

Steps to reproduce

First, you get a coin-pouch and fill it with nuggets. Then you Push yourself into the air and let go of the Push keybind - there's a fair chance that you will continue to be Pushed. (Though I'm not 100% sure what happens to cause the glitch, so...)

Minecraft version

1.19.2 (Latest)

Forge version

43.3.5

Cosmere version

Build 78

Other relevant versions

No response

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

Gerbagel commented 9 months ago

I've seen this too. I'd like to add that it only happens with the coin pouch and that you can engage another push on any metallic object to cancel it. Still annoying to have to do.

R0b0r0b commented 9 months ago

I've seen this too. I'd like to add that it only happens with the coin pouch and that you can engage another push on any metallic object to cancel it. Still annoying to have to do.

Yeah, I've noticed it's only a coin pouch issue too Though that's a helpful tip, thank you!

Gerbagel commented 9 months ago

What I think might be happening is that the code that locks you on to the coin is sometimes forgetting to let go, or just not getting told to let go, so it continues pushing indefinitely. It's hard to replicate at-will, but I'll definitely give it a look :)

R0b0r0b commented 9 months ago

What I think might be happening is that the code that locks you on to the coin is sometimes forgetting to let go, or just not getting told to let go, so it continues pushing indefinitely. It's hard to replicate at-will, but I'll definitely give it a look :)

That might be it, yeah Sounds good :)

leafreynolds commented 9 months ago

Providing some extra context:

It happens multiple different ways. The packet that tells the server you have let go of the keybind gets lost, so it wont clear the list until you try push and let go against another metal object.

Maybe we need to safe guard that a bit more, rather than detecting a key release, check current status of the key then check if there's items in the push list and then just keep trying to release till it finally lets go? that could get buggy though

Gerbagel commented 9 months ago

That's usually how network things are done, no? Just keep trying till it works? Honestly kinda assumed that would be built in to Minecraft's packet handler already

leafreynolds commented 9 months ago

that's my assumption too, unless the client is somehow missing the key release event