Fix jetpack staying visible and audible across interiors - #5134
Open
TheCrazy17 wants to merge 1 commit into
Open
Fix jetpack staying visible and audible across interiors#5134TheCrazy17 wants to merge 1 commit into
TheCrazy17 wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::RenderJetPackto skip the render and FX, andCAEPedAudioEntity::UpdateJetPackto 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