diff --git a/modules/entity_spell_system/world_spawners/ess_entity_world_spawner_3d_area.cpp b/modules/entity_spell_system/world_spawners/ess_entity_world_spawner_3d_area.cpp index 18bbe23b5..97553fa61 100644 --- a/modules/entity_spell_system/world_spawners/ess_entity_world_spawner_3d_area.cpp +++ b/modules/entity_spell_system/world_spawners/ess_entity_world_spawner_3d_area.cpp @@ -50,6 +50,8 @@ void ESSEntityWorldSpawner3DArea::set_spawn_area_extents(const Vector3 &p_extent _spawn_area_extents = p_extents; _spawn_slots_dirty = true; + + update_gizmos(); } int ESSEntityWorldSpawner3DArea::get_spawn_slot_count() const { @@ -59,6 +61,8 @@ void ESSEntityWorldSpawner3DArea::set_spawn_slot_count(const int p_spawn_slot_co _spawn_slot_count = p_spawn_slot_count; _spawn_slots_dirty = true; + + update_gizmos(); } float ESSEntityWorldSpawner3DArea::get_respawn_time_min() const { @@ -201,7 +205,11 @@ ESSEntityWorldSpawner3DArea::ESSEntityWorldSpawner3DArea() { ESSEntityWorldSpawner3DArea::~ESSEntityWorldSpawner3DArea() { } -Vector ESSEntityWorldSpawner3DArea::get_spawn_positions() const { +Vector ESSEntityWorldSpawner3DArea::get_spawn_positions() { + if (_spawn_slots_dirty) { + _recalculate_slots(); + } + Vector pos; for (int i = 0; i < _spawn_slots.size(); ++i) { diff --git a/modules/entity_spell_system/world_spawners/ess_entity_world_spawner_3d_area.h b/modules/entity_spell_system/world_spawners/ess_entity_world_spawner_3d_area.h index f4315699b..ed820a7b0 100644 --- a/modules/entity_spell_system/world_spawners/ess_entity_world_spawner_3d_area.h +++ b/modules/entity_spell_system/world_spawners/ess_entity_world_spawner_3d_area.h @@ -77,7 +77,7 @@ public: ~ESSEntityWorldSpawner3DArea(); // For the gizmo - Vector get_spawn_positions() const; + Vector get_spawn_positions(); protected: bool _set(const StringName &p_name, const Variant &p_value);