I just completed the Battle for Whiterun, and, as per my playstyle, I dismissed Lydia once that was done. When I dismissed her, the Legion (the side I fought for) started attacking her. What can I do to keep Lydia from dying and/or killing everyone?
After messing with various console commands, I figured out one way to solve it. I added Lydia to the Imperial Legion faction with the following console commands:
I also had to use