diff --git a/pets-lib/src/world/enemy_node.rs b/pets-lib/src/world/enemy_node.rs index 7b76b535..1860bb78 100644 --- a/pets-lib/src/world/enemy_node.rs +++ b/pets-lib/src/world/enemy_node.rs @@ -115,7 +115,7 @@ impl WalkingEnemy { self.touched_player = true; godot_print!("Player touched enemy: {}", self.enemy_id); - World::start_battle(&self.enemy_id); + World::start_battle(self.enemy_id.to_godot()); } } diff --git a/pets-lib/src/world/mod.rs b/pets-lib/src/world/mod.rs index 8a647e47..5da79a29 100644 --- a/pets-lib/src/world/mod.rs +++ b/pets-lib/src/world/mod.rs @@ -126,8 +126,10 @@ impl World { srv.set_bus_mute(unmuted, false); } - pub fn start_battle(eid: &EnemyID) { - let enemy_data = EnemyData::from_id(*eid); + #[func] + pub fn start_battle(eid: GString) { + let eid = EnemyID::from_godot(eid); + let enemy_data = EnemyData::from_id(eid); pcb() .bind_mut() .battling