mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix unculled zones not updating when needed.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1034.
This commit is contained in:
13
game/game.py
13
game/game.py
@@ -208,7 +208,7 @@ class Game:
|
||||
naming.namegen = self.name_generator
|
||||
LuaPluginManager.load_settings(self.settings)
|
||||
ObjectiveDistanceCache.set_theater(self.theater)
|
||||
self.compute_conflicts_position()
|
||||
self.compute_unculled_zones()
|
||||
if not game_still_initializing:
|
||||
self.compute_threat_zones()
|
||||
|
||||
@@ -347,8 +347,6 @@ class Game:
|
||||
return self.process_win_loss(turn_state)
|
||||
|
||||
# Plan flights & combat for next turn
|
||||
with logged_duration("Computing conflict positions"):
|
||||
self.compute_conflicts_position()
|
||||
with logged_duration("Threat zone computation"):
|
||||
self.compute_threat_zones()
|
||||
|
||||
@@ -366,6 +364,10 @@ class Game:
|
||||
gplanner.plan_groundwar()
|
||||
self.ground_planners[cp.id] = gplanner
|
||||
|
||||
# Update cull zones
|
||||
with logged_duration("Computing culling positions"):
|
||||
self.compute_unculled_zones()
|
||||
|
||||
def message(self, title: str, text: str = "") -> None:
|
||||
self.informations.append(Information(title, text, turn=self.turn))
|
||||
|
||||
@@ -406,10 +408,9 @@ class Game:
|
||||
def navmesh_for(self, player: bool) -> NavMesh:
|
||||
return self.coalition_for(player).nav_mesh
|
||||
|
||||
def compute_conflicts_position(self) -> None:
|
||||
def compute_unculled_zones(self) -> None:
|
||||
"""
|
||||
Compute the current conflict center position(s), mainly used for culling calculation
|
||||
:return: List of points of interests
|
||||
Compute the current conflict position(s) used for culling calculation
|
||||
"""
|
||||
from game.missiongenerator.frontlineconflictdescription import (
|
||||
FrontLineConflictDescription,
|
||||
|
||||
@@ -19,6 +19,7 @@ def bounded_int_option(
|
||||
max: int,
|
||||
detail: Optional[str] = None,
|
||||
tooltip: Optional[str] = None,
|
||||
causes_expensive_game_update: bool = False,
|
||||
**kwargs: Any,
|
||||
) -> int:
|
||||
return field(
|
||||
@@ -29,7 +30,7 @@ def bounded_int_option(
|
||||
text,
|
||||
detail,
|
||||
tooltip,
|
||||
causes_expensive_game_update=False,
|
||||
causes_expensive_game_update,
|
||||
min=min,
|
||||
max=max,
|
||||
)
|
||||
|
||||
@@ -448,6 +448,7 @@ class Settings:
|
||||
default=100,
|
||||
min=10,
|
||||
max=10000,
|
||||
causes_expensive_game_update=True,
|
||||
)
|
||||
perf_do_not_cull_carrier: bool = boolean_option(
|
||||
"Do not cull carrier's surroundings",
|
||||
|
||||
Reference in New Issue
Block a user