fix tutorial construct order bug
This commit is contained in:
parent
15bc05b3d4
commit
5871f3129b
@ -104,7 +104,6 @@ impl Game {
|
|||||||
// let player_description = player.constructs.iter().map(|c| c.name.clone()).collect::<Vec<String>>().join(", ");
|
// let player_description = player.constructs.iter().map(|c| c.name.clone()).collect::<Vec<String>>().join(", ");
|
||||||
// self.log.push(format!("{:} has joined the game. [{:}]", player.name, player_description));
|
// self.log.push(format!("{:} has joined the game. [{:}]", player.name, player_description));
|
||||||
|
|
||||||
player.constructs.sort_unstable_by_key(|c| c.id);
|
|
||||||
self.players.push(player);
|
self.players.push(player);
|
||||||
|
|
||||||
Ok(self)
|
Ok(self)
|
||||||
|
|||||||
@ -65,7 +65,9 @@ pub struct Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Player {
|
impl Player {
|
||||||
pub fn new(account: Uuid, img: Option<Uuid>, name: &String, constructs: Vec<Construct>) -> Player {
|
pub fn new(account: Uuid, img: Option<Uuid>, name: &String, mut constructs: Vec<Construct>) -> Player {
|
||||||
|
constructs.sort_unstable_by_key(|c| c.id);
|
||||||
|
|
||||||
Player {
|
Player {
|
||||||
id: account,
|
id: account,
|
||||||
img,
|
img,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user