Fix player disconnecting
This commit is contained in:
parent
4c58824840
commit
6ffdd201a7
@ -53,3 +53,14 @@ metadata/_edit_lock_ = true
|
|||||||
[node name="players_list" type="VBoxContainer" parent="v_box_container" unique_id=1834737379]
|
[node name="players_list" type="VBoxContainer" parent="v_box_container" unique_id=1834737379]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
|
[node name="netstats" type="NetStatsLabel" parent="." unique_id=1335814511]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 12
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_top = -144.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 0
|
||||||
|
vertical_alignment = 2
|
||||||
|
|||||||
@ -111,8 +111,8 @@ impl Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_player(&mut self, id: u16) {
|
pub fn remove_player(&mut self, id: u16) {
|
||||||
self.signals().on_player_disconnected().emit(id);
|
|
||||||
self.players.retain(|p| p.id != id);
|
self.players.retain(|p| p.id != id);
|
||||||
|
self.signals().on_player_disconnected().emit(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_player_nick(&mut self, player_id: u16, nick: String) {
|
pub fn update_player_nick(&mut self, player_id: u16, nick: String) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user