Fix bumpcode, fix magnet landing (better fix)
This branch fixes two problems:
- "Bumpcode'd", the phenomenon where a player who gets bonked after being hit by a wipeout-inducing item will be sent backwards, sometimes extremely far.
- Magnet landing (improves upon !256 (merged)'s magnet landing fix), where a player who gets hit by a wipeout-inducing item/bonks, who then bounces on a spring panel sector, gets sent backwards, sometimes extremely far.
The fixes, respectively, are as follows:
- Added speed safeguard (> 0) in the friction reduction block on spinout and wipeout. Turns out, friction does not get set if the player's speed is zero, so their friction keeps being reduced and reduced until it goes to the negatives, leading to the infamous backwards bonking. This is also consistent with other friction calculation code.
-
Moved
!k_pogospring
safeguard to the friction calculation block. Before, it only coveredk_wipeoutslow
's block, but moving it here is more appropriate. When the player is on pogo state, they are technically considered to be on the ground, which also means that their friction eventually goes into the negatives even though they're technically in the air, leading to hilarious backwards rubberbanding when hit by an orbinaut.
Trivial fixes, so no build unless requested.
Here's the script I utilized to test this (adds a forwardsbonk
command with an optional speed parameter): ihurtmyself.lua