Star Trek - The Original Series - A Taste of Armageddon
The planets of Eminiar VII and its neighbouring planet Vendikar are in a virtual reality war. When a virtual hit occurs, the inhabitents are disintegrated on their own accord. When Kirk beams down to the planet, he is told that the Enterprise has been hit. There have casualties and death amongst the crew including in the away team. The Eminiar leader orders crew members to be executed which Capt. James Tiberius Kirk over-rules. Kirk and Spock destroy the computer.