diff --git a/saved_systems/default.lua b/saved_systems/default.lua index 61fa1b3..6bfeb86 100644 --- a/saved_systems/default.lua +++ b/saved_systems/default.lua @@ -1,4 +1,4 @@ add_bodies( {x = 150.000, y = 100.000, x_vel = 0.000, y_vel = 0.000, mass = 75.000, rad = 5.000}, - {x = 215.000, y = 100.000, x_vel = 0.000, y_vel = -1.550, mass = 0.010, rad = 0.800} + {x = 215.000, y = 100.000, x_vel = 0.000, y_vel = -1.100, mass = 0.010, rad = 0.800} ) diff --git a/src/main_state/lua.rs b/src/main_state/lua.rs index c01d4d5..90714f9 100644 --- a/src/main_state/lua.rs +++ b/src/main_state/lua.rs @@ -88,20 +88,9 @@ impl MainState<'_, '_> { ) .exec() .unwrap(); - - if let Ok(lua_init_code) = std::fs::read_to_string("saved_systems/default.lua") { - if let Err(e) = lua_ctx - .load(&lua_init_code) - .set_name("default.lua") - .unwrap() - .exec() - { - println!("Lua {}", e.to_string()); - }; - } }); - self.process_lua_bodies(); + let _ = crate::saveload::load_from_lua(&self.world, "saved_systems/default.lua".to_string()); } pub fn lua_update(&mut self) {