mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +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:
|
for flight in winner:
|
||||||
assert isinstance(flight.state, InCombat)
|
assert isinstance(flight.state, InCombat)
|
||||||
if random.random() / flight.count >= 0.5:
|
if random.random() >= 0.5:
|
||||||
flight.kill(results, events)
|
flight.kill(results, events)
|
||||||
else:
|
else:
|
||||||
flight.state.exit_combat()
|
flight.state.exit_combat()
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class DefendingSam(FrozenCombat):
|
|||||||
|
|
||||||
def resolve(self, results: SimulationResults, events: GameUpdateEvents) -> None:
|
def resolve(self, results: SimulationResults, events: GameUpdateEvents) -> None:
|
||||||
assert isinstance(self.flight.state, InCombat)
|
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")
|
logging.debug(f"Air defense combat auto-resolved with {self.flight} lost")
|
||||||
self.flight.kill(results, events)
|
self.flight.kill(results, events)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user