only broadcast token creation when it is created in the relevant map
This commit is contained in:
parent
1595c5e8eb
commit
53d1d2f831
1 changed files with 5 additions and 1 deletions
|
@ -192,7 +192,11 @@ impl GameServer {
|
|||
} => {
|
||||
let token_id = self.game.create_token(map_id, character, img_path.clone(), x, y);
|
||||
_ = broadcast.send((
|
||||
Some(id.clone()),
|
||||
if map_id == self.game.current_scene() {
|
||||
None
|
||||
} else {
|
||||
Some(id.clone())
|
||||
},
|
||||
api::Response::SpawnToken(SpawnToken {
|
||||
token_id,
|
||||
x,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue