Postby Quantumenace » Sat Apr 04, 2020 12:43 pm
Ha ha, I just figured that making a joke thread into an actual solution would make a good joke in itself.
May as well explain the nature of the bug as determined from Cheat Engine and the source code:
When a player is standing on a moving block, a dummy NPC index at -(player index) is used to store the location struct including the speed. This is why the NPC array goes down to -128. This is only overwritten while the player is on a moving block, however, so it retains the speed of the last moving block the player was on.
While climbing a vine, the index of the vine npc is determined... unless it's a fence BGO, in that case it's set to -1. So, then, NPC -1 has its speed referenced, which would be 0 except for the fact that it's also used to store the speed of the block player 1 was standing on.
This code sets the speeds of NPC[-1] to 0 at onTick. It's possible this has side effects but I haven't found any.
It would also be possible to set the speed based on the layers of fence BGOs intersecting the player for moving fences, but that would only work for player 1 because all players read the speed of NPC -1 instead of their usual dummy NPC index.