Spawn the belt-link action helper on the server only#89
Open
Smiggus wants to merge 1 commit into
Open
Conversation
BL_BeltLinkWeaponComponent.OnPostInit spawned the action helper prefab on every machine. The helper prefab (BL_LinkBeltActionHelper.et) contains an RplComponent, so the server's copy is also streamed to clients - each client ended up with two overlapping helpers: the replicated one (whose Link Belt action works, because PerformAction is server-guarded) and a local-only duplicate whose action can never reach the server. Players saw duplicated action prompts and a Link Belt entry that did nothing. Also guard Resource.Load() against a null result when the helper prefab attribute is left empty. NOTE: should be verified in multiplayer - in particular that the helper still follows vehicle-mounted weapons (M2 CROWS) on clients after this change.
ec32548 to
ac582df
Compare
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.
BL_BeltLinkWeaponComponent.OnPostInitspawned the Link Belt action helper on every machine. The helper prefab carries anRplComponent, so the server's helper already replicates to every client. Each client therefore ended up with two overlapping helpers:PerformActionis server-guarded and routes through the action broadcast), andClients still get the helper after this change; they just get it once, through replication, instead of twice. This removes the doubled "Link belt" prompt where one entry was dead.
Also guards the
Resource.Load()result against null when the helper prefab attribute is left empty.Please verify in MP before merging: helper position on vehicle-mounted weapons (M2 CROWS) on clients, since the client-side copy previously came from the local spawn.