Skip to content

Commit

Permalink
Fix crash when building some towers
Browse files Browse the repository at this point in the history
Towers which access "_stats" inside get_aura_types(), for example Skink
  • Loading branch information
Kvel2D committed Jan 18, 2024
1 parent 98618b9 commit 7f8c6f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Scenes/Towers/TowerPreview.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ func _ready():

var is_tower_preview: bool = true
_tower_instance = TowerManager.get_tower(tower_id, is_tower_preview)
# NOTE: have to init stats because we call
# get_aura_types() on tower. For some towers, calling
# get_aura_types() will touch _stats variable, which is
# initialized by init_stats_and_specials().
_tower_instance.init_stats_and_specials()
add_child(_tower_instance)

var aura_type_list: Array[AuraType] = _tower_instance.get_aura_types()
Expand Down

0 comments on commit 7f8c6f1

Please sign in to comment.