From b19f780d9f59891e6e3658ad024a97f89c89b8a3 Mon Sep 17 00:00:00 2001 From: Imbris Date: Mon, 17 Jan 2022 00:27:27 -0500 Subject: [PATCH] Make Combo also only sync for the client's entity --- common/net/src/synced_components.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/common/net/src/synced_components.rs b/common/net/src/synced_components.rs index 9361ef3049..0db52a0dcb 100644 --- a/common/net/src/synced_components.rs +++ b/common/net/src/synced_components.rs @@ -40,12 +40,10 @@ macro_rules! synced_components { shockwave: Shockwave, beam_segment: BeamSegment, alignment: Alignment, - // TODO: evaluate if this can be `FromClient` - combo: Combo, // TODO: evaluate if this is used on the client, // and if so what it is used for player: Player, - // TODO: change this to FromClient and sync the bare minimum + // TODO: change this to `SyncFrom::ClientEntity` and sync the bare minimum // from other entities (e.g. just keys needed to show appearance // based on their loadout). Also, it looks like this actually has // an alternative sync method implemented in entity_sync via @@ -55,6 +53,7 @@ macro_rules! synced_components { // Synced to the client only for its own entity + combo: Combo, skill_set: SkillSet, active_abilities: ActiveAbilities, can_build: CanBuild, @@ -186,10 +185,6 @@ impl NetSync for Alignment { const SYNC_FROM: SyncFrom = SyncFrom::AllEntities; } -impl NetSync for Combo { - const SYNC_FROM: SyncFrom = SyncFrom::AllEntities; -} - impl NetSync for Player { const SYNC_FROM: SyncFrom = SyncFrom::AllEntities; } @@ -198,6 +193,12 @@ impl NetSync for Inventory { const SYNC_FROM: SyncFrom = SyncFrom::AllEntities; } +// SyncFrom::ClientEntity + +impl NetSync for Combo { + const SYNC_FROM: SyncFrom = SyncFrom::ClientEntity; +} + impl NetSync for SkillSet { const SYNC_FROM: SyncFrom = SyncFrom::ClientEntity; }