Automatically setup scripts aswell in the base classes.

This commit is contained in:
Relintai 2020-07-21 22:44:14 +02:00
parent 457de8cb4c
commit bc7b040fc3
4 changed files with 12 additions and 0 deletions

View File

@ -294,6 +294,9 @@ Ref<Biome> Biome::_instance(const int seed, Ref<Biome> biome) {
if (!inst.is_valid())
inst.instance();
if (inst->get_script().is_null() && !get_script().is_null())
inst->set_script(get_script());
inst->set_current_seed(seed);
inst->set_level_range(_level_range);

View File

@ -476,6 +476,9 @@ Ref<Dungeon> Dungeon::_instance(const int seed, Ref<Dungeon> dungeon) {
if (!inst.is_valid())
inst.instance();
if (inst->get_script().is_null() && !get_script().is_null())
inst->set_script(get_script());
inst->set_current_seed(seed);
inst->set_level_range(_level_range);

View File

@ -334,6 +334,9 @@ Ref<DungeonRoom> DungeonRoom::_instance(const int seed, Ref<DungeonRoom> dungeon
if (!inst.is_valid())
inst.instance();
if (inst->get_script().is_null() && !get_script().is_null())
inst->set_script(get_script());
inst->set_current_seed(seed);
inst->set_level_range(_level_range);

View File

@ -239,6 +239,9 @@ Ref<Planet> Planet::_instance(const int seed, Ref<Planet> planet) {
if (!inst.is_valid())
inst.instance();
if (inst->get_script().is_null() && !get_script().is_null())
inst->set_script(get_script());
inst->set_id(_id);
inst->set_current_seed(seed);
inst->set_level_range(_level_range);