safeguard commands

This commit is contained in:
AviiNL
2023-12-23 08:53:46 +01:00
parent 8851594537
commit 05f4859f67
14 changed files with 749 additions and 282 deletions

View File

@@ -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
};