unorthodox-paradox / omsi_2_csb_ai_enhancements

AI enhancements for CSB vehicles
1 stars 0 forks source link

Inconsistent door adjustment after emergency door valve resetting #74

Closed unorthodox-paradox closed 5 years ago

unorthodox-paradox commented 5 years ago

Symptoms

Issue A:

  1. Spawn a vehicle with insufficient air pressure for door operation.
  2. Turn a door's opening valve open.
  3. Turn it back closed.
  4. Hit the corresponding dashboard door control button.

Outcome: Door opening or closing gets triggered, in spite of the lacking pressure. Expected outcome: Nothing happens.

Note: This doesn't only apply to insufficient pressure but to all the usual preconditions to door adjustment (e.g., notably, power availability), which are effectively ignored if door re-pressurization had previously taken place.

Issue B: Repeat the above process for both doors. You will notice that there is an inconsistency between the acquired target state of the two doors, with the front one always ending up re-opening, as opposed to the rear one apparently properly varying its acquired target state based on the negation of the previous one (if opened far enough while the emergency valve was open, closure gets triggered; otherwise opening gets triggered).

Identified causes and resolution progress

Both issues are caused out of duplication and lack of proper coordination between the logic responsible for a) regular door opening / closing, and b) opening / closing in the context of an emergency valve having previously been open. The pertinent code should be refactored / merged.

User-level workarounds

None available.

Credits

Thanks to Florito, whose meticulous testing helped reveal the general case of this bug.