mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
fix another priority issue
This commit is contained in:
parent
89f43e4bf3
commit
4c837741f4
1 changed files with 16 additions and 1 deletions
|
@ -272,6 +272,8 @@ impl WorldManager {
|
|||
} else {
|
||||
new_auth = Some(new.0)
|
||||
}
|
||||
} else {
|
||||
*stop_sending = false
|
||||
}
|
||||
let mut new_auth_got = false;
|
||||
if !*stop_sending {
|
||||
|
@ -502,7 +504,9 @@ impl WorldManager {
|
|||
}
|
||||
WorldNetMessage::LoseAuthority {chunk, new_authority, new_priority} => {
|
||||
if let Some(ChunkState::Authority {new_authority: new_auth, ..}) = self.chunk_state.get_mut(&chunk) {
|
||||
if let Some(new) = new_auth {
|
||||
if new_authority == self.my_peer_id {
|
||||
*new_auth = None;
|
||||
} else if let Some(new) = new_auth {
|
||||
if new.1 > new_priority
|
||||
{
|
||||
*new_auth = Some((new_authority, new_priority));
|
||||
|
@ -626,6 +630,17 @@ impl WorldManager {
|
|||
self.chunk_state.insert(delta.chunk_coord, cs);
|
||||
}
|
||||
}
|
||||
_ if take_auth =>
|
||||
{
|
||||
self.emit_msg(
|
||||
Destination::Peer(source),
|
||||
WorldNetMessage::LoseAuthority {
|
||||
chunk: delta.chunk_coord,
|
||||
new_priority: priority,
|
||||
new_authority: source,
|
||||
}
|
||||
);
|
||||
}
|
||||
_ => { return }
|
||||
}
|
||||
self.inbound_model.apply_chunk_delta(&delta);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue