mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Make flight death chance not impossible.
The odds of random.random() returning exactly 1.0 are basically nil, and that was the only way a non-solo flight could lose this.
This commit is contained in:
parent
005090fbcd
commit
895a4eb0dc
@ -92,7 +92,7 @@ class AirCombat(JoinableCombat):
|
||||
|
||||
for flight in winner:
|
||||
assert isinstance(flight.state, InCombat)
|
||||
if random.random() / flight.count >= 0.5:
|
||||
if random.random() >= 0.5:
|
||||
flight.kill(results, events)
|
||||
else:
|
||||
flight.state.exit_combat()
|
||||
|
||||
@ -39,7 +39,7 @@ class DefendingSam(FrozenCombat):
|
||||
|
||||
def resolve(self, results: SimulationResults, events: GameUpdateEvents) -> None:
|
||||
assert isinstance(self.flight.state, InCombat)
|
||||
if random.random() / self.flight.count >= 0.5:
|
||||
if random.random() >= 0.5:
|
||||
logging.debug(f"Air defense combat auto-resolved with {self.flight} lost")
|
||||
self.flight.kill(results, events)
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user