aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/bot.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-19 23:50:23 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-19 23:50:23 +0200
commitab83f982601d93b2399102c4d030fd6e13c4c735 (patch)
treec0536ca9e328707d6b4f4cfc7a2307713466a5be /server/src/entity/bot.rs
parent231a5ce21fcee9195fcc504ee672e4464d627c47 (diff)
downloadhurrycurry-ab83f982601d93b2399102c4d030fd6e13c4c735.tar
hurrycurry-ab83f982601d93b2399102c4d030fd6e13c4c735.tar.bz2
hurrycurry-ab83f982601d93b2399102c4d030fd6e13c4c735.tar.zst
Refactor and move interaction code
Diffstat (limited to 'server/src/entity/bot.rs')
-rw-r--r--server/src/entity/bot.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/src/entity/bot.rs b/server/src/entity/bot.rs
index 9627bb76..51a09b62 100644
--- a/server/src/entity/bot.rs
+++ b/server/src/entity/bot.rs
@@ -18,6 +18,7 @@
use super::{Entity, EntityContext};
use anyhow::Result;
use hurrycurry_bot::{BotAlgo, DynBotAlgo};
+use hurrycurry_locale::TrError;
use hurrycurry_protocol::{Character, Hand, ItemLocation, PacketS, PlayerClass, PlayerID};
use log::debug;
use std::any::Any;
@@ -47,7 +48,7 @@ impl<T: BotAlgo + Any> Entity for BotDriver<T> {
fn finished(&self) -> bool {
self.left
}
- fn tick(&mut self, c: EntityContext<'_>) -> Result<()> {
+ fn tick(&mut self, c: EntityContext<'_>) -> Result<(), TrError> {
if let Some((name, character, class)) = self.join_data.take() {
self.id = c.game.get_unused_player_id(); // TODO clashes when multiple bots join in the same tick
debug!("join {}", self.id);