Skip to content

Spawn the belt-link action helper on the server only#89

Open
Smiggus wants to merge 1 commit into
7Cav:mainfrom
Smiggus:fix/belt-link-helper-duplicate-spawn
Open

Spawn the belt-link action helper on the server only#89
Smiggus wants to merge 1 commit into
7Cav:mainfrom
Smiggus:fix/belt-link-helper-duplicate-spawn

Conversation

@Smiggus

@Smiggus Smiggus commented Jul 4, 2026

Copy link
Copy Markdown

BL_BeltLinkWeaponComponent.OnPostInit spawned the Link Belt action helper on every machine. The helper prefab carries an RplComponent, so the server's helper already replicates to every client. Each client therefore ended up with two overlapping helpers:

  • the replicated one, whose Link Belt action works (PerformAction is server-guarded and routes through the action broadcast), and
  • a local-only duplicate whose action can never reach the server and silently does nothing.

Clients 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.

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.
@Smiggus Smiggus force-pushed the fix/belt-link-helper-duplicate-spawn branch from ec32548 to ac582df Compare July 7, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant