Fix fetching Game singleton
This commit is contained in:
parent
8c0d5b99ff
commit
460b362d5c
@ -363,9 +363,13 @@ impl Game {
|
||||
pub fn on_player_killed(player: u16);
|
||||
|
||||
pub fn singleton() -> Option<Gd<Game>> {
|
||||
GameManager::singleton()
|
||||
.get_child(0)
|
||||
.map(|g| g.cast::<Game>())
|
||||
if GameManager::singleton().get_children().len() > 0 {
|
||||
GameManager::singleton()
|
||||
.get_child(0)
|
||||
.map(|g| g.cast::<Game>())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn start_playback(&mut self, time_delta: f64, spectated_id: u16) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user