Apply side effects for tuple args systems (#8)

* Apply side effects for tuple args systems.

Deferred side effects(Commands) that were pushed in scripting exposed
systems were only applied for argument-less systems.
This PR fixes this by applying deferred side effects in macro that
implement functions with arguments.

* Bump version
This commit is contained in:
Jarosław Konik 2023-08-23 18:29:48 +02:00 committed by GitHub
parent 8997159e2f
commit 928f5437fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "bevy_scriptum"
authors = ["Jaroslaw Konik <konikjar@gmail.com>"]
version = "0.2.1"
version = "0.2.2"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"

View file

@ -85,7 +85,9 @@ macro_rules! impl_tuple {
let args = (
$(args.0.get($idx).unwrap().clone_cast::<$t>(), )+
);
Dynamic::from(inner_system.run(args, world))
let result = inner_system.run(args, world);
inner_system.apply_deferred(world);
Dynamic::from(result)
};
let system = IntoSystem::into_system(system_fn);
CallbackSystem {