This commit is contained in:
Jaroslaw Konik 2025-05-21 22:12:55 +02:00
parent 86e7567438
commit 35efc45a20
2 changed files with 3 additions and 2 deletions

View file

@ -111,13 +111,13 @@ macro_rules! impl_tuple {
let system_fn = move |args: In<Vec<RN::Value>>, world: &mut World| {
let mut runtime = world.get_resource_mut::<RN>().expect("No runtime resource");
let args = if RN::needs_own_thread() {
runtime.with_engine_mut(move |engine| {
runtime.with_engine_thread_mut(move |engine| {
(
$($t::from_runtime_value_with_engine(args.get($idx).expect(&format!("Failed to get function argument for index {}", $idx)).clone(), engine), )+
)
})
} else {
runtime.with_engine_thread_mut(move |engine| {
runtime.with_engine_mut(move |engine| {
(
$($t::from_runtime_value_with_engine(args.get($idx).expect(&format!("Failed to get function argument for index {}", $idx)).clone(), engine), )+
)

View file

@ -1,6 +1,7 @@
// TODO: install with CC=clang rbenv install 3.4.3
// TODO: adjust rhai examples and docs or maybe more rhai changes to different PR or even better
// find a better way to test them(dont wrap, generic bevy etc)
// TODO: Move with_engine_thread and with_engine to 2 separate traits
use std::{
collections::HashMap,