Skip to content

Commit

Permalink
Fix crash in Owl of Wisdom
Browse files Browse the repository at this point in the history
load_triggers() in Owl of Wisdom uses _stats.periodic_event_period
\ which is initialized in get_tier_stats()->init_stats_and_specials()
So need a specific order
  • Loading branch information
Kvel2D committed Feb 12, 2024
1 parent 048b614 commit 4fa3ff6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Scenes/Towers/Tower.gd
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ func _ready():
var outline_thickness: float = 6.0
_set_sprite_node(_sprite, outline_thickness)

var triggers_buff_type: BuffType = BuffType.new("", 0, 0, true, self)
triggers_buff_type.set_hidden()
triggers_buff_type.set_buff_tooltip("Triggers buff for tower")
load_triggers(triggers_buff_type)
triggers_buff_type.apply_to_unit_permanent(self, self, 0)

# Apply offsets to account for tower being "on the second floor".
# Visual nodes get moved up by one tile.
# Also move selection visual because it's placed at ground
Expand Down Expand Up @@ -203,6 +197,15 @@ func _ready():

init_stats_and_specials()

# NOTE: need to call load_triggers() after calling
# init_stats_and_specials() because stats must be
# available in load_triggers().
var triggers_buff_type: BuffType = BuffType.new("", 0, 0, true, self)
triggers_buff_type.set_hidden()
triggers_buff_type.set_buff_tooltip("Triggers buff for tower")
load_triggers(triggers_buff_type)
triggers_buff_type.apply_to_unit_permanent(self, self, 0)

tower_init()

# NOTE: must setup aura's after calling tower_init()
Expand Down

0 comments on commit 4fa3ff6

Please sign in to comment.