Skip to content

Commit

Permalink
fixed start_battle to accept gstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamby777 committed Aug 18, 2024
1 parent ac85c13 commit 3a7a0d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pets-lib/src/world/enemy_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
6 changes: 4 additions & 2 deletions pets-lib/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a7a0d6

Please sign in to comment.