Skip to content

Relay weapon changes so remote players show their equipped weapon#19

Open
constripacity wants to merge 1 commit into
mainfrom
fix/relay-weapon-changes
Open

Relay weapon changes so remote players show their equipped weapon#19
constripacity wants to merge 1 commit into
mainfrom
fix/relay-weapon-changes

Conversation

@constripacity
Copy link
Copy Markdown
Member

@constripacity constripacity commented May 30, 2026

Problem

The change weapon action (HandleGameActions case 0) was log-only it printed the weapon change but never told other clients. So remote players' avatars rendered no weapon.

Fix

Store the player's weapon server-side and relay it as protocol 2 / argument 2. The client already handles this (Client.PlayerChangeWeapon → NetworkPlayer.EquipWeapon), so no client change is needed.

Testing

Two clients in a match: switching/equipping a weapon now shows on the other player's avatar. Verified live.

Known limitation (follow-up)

A player who joins after another equipped won't see that weapon until the equipped player switches again the handshake doesn't send current weapons, only changes are relayed. A small follow-up can replay current weapons to new joiners.

The 'change weapon' action (HandleGameActions case 0) was log-only, so
other clients never learned which weapon a player equipped and rendered
no weapon on remote avatars. Store the weapon on the player's data and
relay it (protocol 2 / argument 2), which the client already handles
(PlayerChangeWeapon -> EquipWeapon).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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