Open GooberRF opened 1 month ago
Withdrawing for now, this PR has a bug that I discovered, still not sure of the cause. Nevertheless, it's also not made properly. I plan to redo it using CodeInjection to only handle the relatively velocity, rather than rewriting the function entirely.
What was the logic error?
What was the logic error?
I'm not 100% sure what causes it, but with this change, sometimes after a player teleports, they are stuck in a strange state - they appear out of the level on their client, but each other client sees that player's name in the middle of the screen as if they were staring at them. I suspect it has something to do with the values that are being set in this PR, but not sure which one exactly. It also only happens sometimes.
I'm pretty sure only the velocity conversion is actually necessary. I'm planning to redo this via CodeInjection soon.
This PR adjusts the behaviour of the
Teleport_Player
event such that relative velocity is maintained when teleporting. This means that when you go into a teleporter, you come out of the teleporter going the same speed, regardless of the direction of the teleport destination relative to the teleport entrance.Functionally this vastly improves the experience when teleporting - you no longer run into a teleporter and come out flying sideways or something.
Resolves #19
This PR also makes two other much more minor adjustments which I'll note just for the record:
L20S2.rfl
(which teleports your vehicle instead of dumping you out of the vehicle like is normally the case) more specific - base game only checked the level filename when deciding whether to apply the hackfix, after this PR it also checks the event UID. This is very, very minor, but it is safer to do it this way just to avoid any potential unexpected behaviour in mods that modify this level.