untoldwind / KontrolSystem2

Autopilot scripting system for KSP2
Other
54 stars 15 forks source link

Ambigious error Invalid IL code #79

Closed SodaPopinski closed 1 year ago

SodaPopinski commented 1 year ago

Got error in the console: Module hover_test terminated with: Invalid IL code in HOVER_TEST/AsyncFunction_main_flight:PollValue (): IL_02e0: call 0x0a00009a

pub fn get_hover_throt (vessel: Vessel) -> float = { let vertpit = abs(vessel.facing.vector.angle_to(vessel.up)) let thrustcorrect = 1/math::cos_deg(vertpit) thrustcorrect((vessel.mass)grav_force(vessel) / vessel.available_thrust) }

pub fn grav_force (vessel: Vessel) -> float = { vessel.orbit.reference_body.grav_parameter / pow((vessel.orbit.reference_body.radius + vessel.altitude_sealevel),2.0) }

//pulled from the loop //this works fine let throt = get_hover_throt(vessel) throttle_manager.throttle = throt //replacing the two lines above with this, gets the error.
throttle_manager.throttle = get_hover_throt(vessel) //causing an IL function error

untoldwind commented 1 year ago

Should be fixed in 0.3.4

untoldwind commented 1 year ago

Closing this for now. Just reopen if it occurs again