safeguard commands
This commit is contained in:
@@ -21,11 +21,14 @@ impl Resource for BogeyDope {}
|
||||
|
||||
pub fn bogey_dope(
|
||||
mut commands: Commands,
|
||||
cmd: ConsoleCommand<BogeyDope>,
|
||||
mut cmd: ConsoleCommand<BogeyDope>,
|
||||
awacs: Query<&Callsign>,
|
||||
player: Query<(&Callsign, &Position)>,
|
||||
npc: Query<(&Position, &Heading), (Without<Player>, With<Red>)>,
|
||||
) {
|
||||
let Some(Ok(BogeyDope)) = cmd.take() else {
|
||||
return;
|
||||
};
|
||||
let Some(pilot) = &cmd.pilot else {
|
||||
return; // no pilot
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user