Skip to content

Commit

Permalink
pal4: Fix leader invisible after scene loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dontpanic92 committed Mar 31, 2024
1 parent a572060 commit 1ec67d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions yaobow/shared/src/openpal4/app_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ impl Pal4AppContext {

pub fn set_player_pos(&mut self, player: i32, pos: &Vec3) {
let player = self.map_player(player);
self.scene.get_player(player).set_visible(true);

self.scene
.get_player(player)
Expand Down Expand Up @@ -139,6 +140,7 @@ impl Pal4AppContext {
pub fn load_scene(&mut self, scene_name: &str, block_name: &str) {
let _ = self.scene_manager.pop_scene();
let scene = Pal4Scene::load(&self.loader, scene_name, block_name).unwrap();
self.set_leader(self.leader as i32);
self.scene_manager.push_scene(scene.scene.clone());

self.scene = scene;
Expand Down
3 changes: 1 addition & 2 deletions yaobow/shared/src/openpal4/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ impl Pal4Scene {
load_player(asset_loader, Player::MurongZiying),
];

scene.add_entity(players[Self::ID_YUN_TIANHE].clone());
for p in &players {
//scene.add_entity(p.clone());
scene.add_entity(p.clone());
}

let npc_info = asset_loader.load_npc_info(scene_name, block_name)?;
Expand Down
2 changes: 1 addition & 1 deletion yaobow/yaobow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ uuid = "0.8"

[dependencies.log]
version = "0.4.14"
features = ["max_level_warn", "release_max_level_warn"]
features = ["max_level_debug", "release_max_level_debug"]

[target.'cfg(target_os = "android")'.dependencies]
ndk = "0.5.0"
Expand Down

0 comments on commit 1ec67d3

Please sign in to comment.