jarkonik / bevy_scriptum

📜 A plugin for Bevy that allows you to write some of your game logic in a scripting language.
https://jarkonik.github.io/bevy_scriptum/
Apache License 2.0
82 stars 4 forks source link

Commands not working when using a function with a In<> param! #7

Closed zwazel closed 1 year ago

zwazel commented 1 year ago

Thanks again for fixing #4 so fast. Sadly I found out it did not fix my particular bug!

Describe the bug A function just like you showed in the new example works perfectly fine:

fn spawn_entity(mut commands: Commands) {
    commands.spawn(Name::new("CONTROL ENTITY"));
}

In my particular case I want a function that takes in an argument:

fn spawn_entity(In((mod_names,)): In<(ImmutableString,)>,mut commands: Commands) {
    println!("Spawning entity: {:?}", mod_names);
    commands.spawn(Name::new("CONTROL ENTITY"));
}

And as soon as I add this In<> param it doesnt work anymore! (Same bug as described in #4)

To Reproduce Steps to reproduce the behavior:

  1. Repeat steps for #4
  2. Add a In<> param to the function
  3. It shouldn't work anymore

Expected behavior For it to spawn the entity with all components.

Screenshots (see screenshot in #4)

jarkonik commented 1 year ago

Thank you for another great bug report. Fixed in v0.2.2.