Skip to content

Commit 1c5ee3d

Browse files
committed
Use more player info from local player for stuff like entities
1 parent 02f3383 commit 1c5ee3d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

game/legacy-proxy/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ impl Client {
15931593
}
15941594
}
15951595
SnapObj::ClientInfo(client_info) => {
1596-
if let Some((character_id, info)) = Self::player_info_mut(id, base, snapshot) {
1596+
if let Some((_, info)) = Self::player_info_mut(id, base, snapshot) {
15971597
fn ints_to_net_str<const MAX_LENGTH: usize>(
15981598
int_arr: &[i32],
15991599
) -> NetworkString<MAX_LENGTH> {
@@ -1605,14 +1605,14 @@ impl Client {
16051605
.map(NetworkString::new_lossy)
16061606
.unwrap_or_default()
16071607
}
1608-
let mut player_info = (*info.player_info).clone();
16091608

16101609
// Apply as much info from known player info as possible
1611-
if character_id == player_id {
1612-
player_info = player.player_info.clone();
1613-
} else if let Some(dummy) = base.local_players.get(&id) {
1614-
player_info = dummy.player_info.clone();
1615-
}
1610+
let mut player_info = if let Some(dummy) = base.local_players.get(&id) {
1611+
dummy.player_info.clone()
1612+
} else {
1613+
// fall back to player info, since legacy servers don't send enough info
1614+
player.player_info.clone()
1615+
};
16161616

16171617
// Then overwrite the info the server knows about
16181618
player_info.name = ints_to_net_str(client_info.name.as_slice());

0 commit comments

Comments
 (0)