The network ID for player is created twice: for entity (in spawn callback) and for client (in create_client), causing player network IDs to be 0, 2, 4 when rejoining. This PR fixes this so that network IDs are only created in entity spawn callback.
Related issues
Checklist
[x] Ran cargo fmt, cargo clippy --all-targets, cargo build --release and cargo test and fixed any generated errors!
[ ] Removed unnecessary commented out code
[ ] Used specific traces (if you trace actions please specify the cause i.e. the player)
Note: if you locally don't get any errors, but GitHub Actions fails (especially at clippy) you might want to check your rust toolchain version. You can then feel free to fix these warnings/errors in your PR.
Fix double creation of network IDs for players
Status
Description
The network ID for player is created twice: for entity (in spawn callback) and for client (in create_client), causing player network IDs to be 0, 2, 4 when rejoining. This PR fixes this so that network IDs are only created in entity spawn callback.
Related issues
Checklist
cargo fmt
,cargo clippy --all-targets
,cargo build --release
andcargo test
and fixed any generated errors!Note: if you locally don't get any errors, but GitHub Actions fails (especially at
clippy
) you might want to check your rust toolchain version. You can then feel free to fix these warnings/errors in your PR.