perf: harden runtime for weaker hardware
This commit is contained in:
@@ -8,7 +8,6 @@ const HOSTILE_SCENE := preload("res://world/combat/HostileCombatant.tscn")
|
||||
@export var wolf_spawn_positions: PackedVector3Array = PackedVector3Array()
|
||||
|
||||
var hostiles: Dictionary = {}
|
||||
var _initialized := false
|
||||
var _wolves_spawned := false
|
||||
|
||||
|
||||
@@ -20,7 +19,6 @@ func _ready() -> void:
|
||||
simulation_manager.combatant_spawned.connect(_on_combatant_spawned)
|
||||
simulation_manager.combatant_died.connect(_on_combatant_died)
|
||||
simulation_manager.state_restored.connect(_on_state_restored)
|
||||
_initialized = true
|
||||
call_deferred("_spawn_wolves")
|
||||
_refresh_from_state()
|
||||
|
||||
@@ -34,14 +32,6 @@ func _spawn_wolves() -> void:
|
||||
simulation_manager.spawn_wolf(position)
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not _initialized:
|
||||
return
|
||||
for combatant_id in _hostile_ids():
|
||||
if not hostiles.has(combatant_id):
|
||||
_spawn_visual(combatant_id)
|
||||
|
||||
|
||||
func _hostile_ids() -> Array:
|
||||
var ids: Array[StringName] = []
|
||||
var living: Array = simulation_manager.get_living_hostile_combatants()
|
||||
|
||||
Reference in New Issue
Block a user