Commit a4f1820
authored
#### Summary
Preserve plane rotor speed across vehicle recreation so that changing a
plane's variant no longer causes a visible propeller stall.
Save `m_fPlaneRotorSpeed` in `Destroy()` and restore it in `Create()`,
matching the existing heli rotor speed path.
#### Motivation
Fixes #4329. After #3486, calling `setVehicleVariant` on a plane (e.g.
cropduster) causes the propeller to stop for about one second before
ramping back up. `Destroy()` saved `m_fHeliRotorSpeed` but never saved
`m_fPlaneRotorSpeed`, and `Create()` only restored rotor speed for
`CLIENTVEHICLE_HELI`. Planes went through the recreate cycle with prop
speed reset to zero.
#### Test plan
1. Spawn a cropduster with the engine on
2. Call `setVehicleVariant` repeatedly
3. Observe that the propeller maintains its speed with no interruption
#### Checklist
* [x] Your code should follow the [coding
guidelines](https://wiki.multitheftauto.com/index.php?title=Coding_guidelines).
* [x] Smaller pull requests are easier to review. If your pull request
is beefy, your pull request should be reviewable commit-by-commit.
1 parent 6946e99 commit a4f1820
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2673 | 2673 | | |
2674 | 2674 | | |
2675 | 2675 | | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
2676 | 2680 | | |
2677 | 2681 | | |
2678 | 2682 | | |
| |||
2995 | 2999 | | |
2996 | 3000 | | |
2997 | 3001 | | |
| 3002 | + | |
2998 | 3003 | | |
2999 | 3004 | | |
3000 | 3005 | | |
| |||
0 commit comments