optimize path finding
This commit is contained in:
@@ -29,4 +29,10 @@ ron = "0.8.1"
|
||||
image = "0.25.2"
|
||||
|
||||
[features]
|
||||
tracing = ["bevy/trace_tracy", "world_generation/tracing", "buildings/tracing"]
|
||||
tracing = [
|
||||
"bevy/trace_tracy",
|
||||
"world_generation/tracing",
|
||||
"buildings/tracing",
|
||||
"units/tracing",
|
||||
"shared/tracing",
|
||||
]
|
||||
|
||||
@@ -24,7 +24,12 @@ fn update_tile_under_cursor(
|
||||
map: Res<Map>,
|
||||
mut tile_under_cursor: ResMut<TileUnderCursor>,
|
||||
) {
|
||||
let win = window.single();
|
||||
let win_r = window.get_single();
|
||||
if win_r.is_err() {
|
||||
return;
|
||||
}
|
||||
let win = win_r.unwrap();
|
||||
|
||||
let (cam_transform, camera) = cam_query.single();
|
||||
let Some(cursor_pos) = win.cursor_position() else {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user