diff options
Diffstat (limited to 'azalea/examples/testbot/killaura.rs')
| -rw-r--r-- | azalea/examples/testbot/killaura.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/azalea/examples/testbot/killaura.rs b/azalea/examples/testbot/killaura.rs index 136ae7dd..37f65ab2 100644 --- a/azalea/examples/testbot/killaura.rs +++ b/azalea/examples/testbot/killaura.rs @@ -13,7 +13,7 @@ pub fn tick(bot: Client, state: State) -> eyre::Result<()> { if bot.has_attack_cooldown() { return Ok(()); } - let bot_position = bot.eye_position(); + let bot_position = bot.eye_position()?; let nearest_entity = bot.nearest_entity_by::<&Position, ( With<AbstractMonster>, @@ -22,7 +22,7 @@ pub fn tick(bot: Client, state: State) -> eyre::Result<()> { )>(|position: &Position| { let distance = bot_position.distance_to(**position); distance < 4. - }); + })?; if let Some(nearest_entity) = nearest_entity { println!("attacking {nearest_entity:?}"); |
