@@ -204,14 +204,14 @@ impl NetworkHandler {
204204 ctx. sim . definitions . reset_sync ( ) ;
205205 if to == client. get_server_name ( ) {
206206 info ! ( "[CONTROL] Taking control from {}" , from) ;
207- ctx. sim . definitions . on_control_change ( & ctx . sim . conn , true ) ;
207+ ctx. sim . take_control ( ) ;
208208 ctx. app . gain_control ( ) ;
209209 state. clients . set_no_control ( ) ;
210210 // Someone else has controls, if we have controls we let go and listen for their messages
211211 } else {
212212 if from == client. get_server_name ( ) {
213213 ctx. app . lose_control ( ) ;
214- ctx. sim . definitions . on_control_change ( & ctx . sim . conn , false ) ;
214+ ctx. sim . lose_control ( ) ;
215215 }
216216 info ! ( "[CONTROL] {} is now in control." , to) ;
217217 ctx. app . set_incontrol ( & to) ;
@@ -275,8 +275,7 @@ impl NetworkHandler {
275275 if client. is_host ( ) {
276276 info ! ( "[CONTROL] {} had control, taking control back." , name) ;
277277 ctx. app . gain_control ( ) ;
278-
279- ctx. sim . definitions . on_control_change ( & ctx. sim . conn , true ) ;
278+ ctx. sim . take_control ( ) ;
280279 client. transfer_control ( client. get_server_name ( ) . to_string ( ) ) ;
281280 }
282281 }
@@ -331,7 +330,7 @@ impl NetworkHandler {
331330 )
332331 }
333332 // Freeze aircraft
334- ctx. sim . definitions . on_control_change ( & ctx . sim . conn , false ) ;
333+ ctx. sim . lose_control ( ) ;
335334 }
336335 Err ( e) => {
337336 error ! (
0 commit comments