Skip to content

Fix jetpack staying visible and audible across interiors - #5134

Open
TheCrazy17 wants to merge 2 commits into
multitheftauto:masterfrom
TheCrazy17:fix/jetpack-interior-visibility
Open

Fix jetpack staying visible and audible across interiors#5134
TheCrazy17 wants to merge 2 commits into
multitheftauto:masterfrom
TheCrazy17:fix/jetpack-interior-visibility

Conversation

@TheCrazy17

Copy link
Copy Markdown
Contributor

Summary

The jetpack model, its thruster FX and its engine sound are each driven by their own clump/channels, separate from the ped's own; interior-based hiding only alphas the ped's clump, so none of the three were ever actually hidden by it. A ped in a different interior still showed and played a full jetpack.

Hooks CTaskSimpleJetPack::RenderJetPack to skip the render and FX, and CAEPedAudioEntity::UpdateJetPack to release the sound channels while hidden and recreate them once visible again, both keyed off the ped's own area code against the camera's current one.

Motivation

Fixes #598.

Test plan

Tested with two peds independently, plus the local player, each wearing a jetpack and switching interior back and forth. For each: visible and audible when sharing the camera's interior; model, thruster FX and engine sound all gone when it doesn't; everything restores correctly (sound included) when returning to a shared interior. Each ped's state is independent of the others.

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

The jetpack model, its thruster FX and its engine sound are each driven by their own clump/channels, separate from the ped's; interior-based hiding only alphas the ped's own clump, so none of the three were ever actually hidden by it.
Hooks CTaskSimpleJetPack::RenderJetPack to skip the render and FX, and CAEPedAudioEntity::UpdateJetPack to release/recreate the sound channels, both keyed off the ped's own area code.

@FileEX FileEX left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These hooks should be in CMultiplayerSA_Peds.

Comment thread Client/multiplayer_sa/CMultiplayerSA.cpp Outdated
Comment thread Client/multiplayer_sa/CMultiplayerSA.cpp Outdated
@FileEX FileEX added the bugfix Solution to a bug of any kind label Aug 15, 2026
@TheCrazy17

Copy link
Copy Markdown
Contributor Author

These hooks should be in CMultiplayerSA_Peds.

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Player jetpack is interiorless

2 participants