Skip to content

Commit

Permalink
no longer problem at looping through empty vec
Browse files Browse the repository at this point in the history
  • Loading branch information
zwazel committed Nov 17, 2023
1 parent 1de2393 commit bde4b3d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions examples/rhai/wrappers_rhai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ fn run_one_shot(world: &mut World) {
for array_element in my_thing.array {
print(`MyThing.array element: ${array_element}`);
}
print(`MyThing.empty_array: ${my_thing.empty_array}`);
print(`Looping through MyThing.empty_array:`);
// this currently returns error:
// ERROR bevy_mod_scripting_rhai: Runtime error in script `script.rhai` Runtime error: Invalid reflection path: `[0]`. No such element (line 20, position 78) in call to function 'once'
//for empty_array_element in my_thing.empty_array {
// print(`MyThing.empty_array element: ${empty_array_element}`);
//}
for empty_array_element in my_thing.empty_array {
print(`MyThing.empty_array element: ${empty_array_element}`);
}
// this currently returns error:
// ERROR bevy_mod_scripting_rhai: Runtime error in script `script.rhai` Function not found: do_something_cool (bevy_script_api::script_ref::ReflectedValue) (line 21, position 72) in call to function 'once'
Expand Down

0 comments on commit bde4b3d

Please sign in to comment.