From a73f61628b21e57b6fe8c74d6a8c84bfbfceb7be Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 16 Feb 2020 16:17:19 +0100 Subject: [PATCH] Added deferred versions of request_world_spell_spawn, and request_world_spell. --- singletons/entity_data_manager.cpp | 8 ++++++++ singletons/entity_data_manager.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/singletons/entity_data_manager.cpp b/singletons/entity_data_manager.cpp index b2f459b..6858d50 100644 --- a/singletons/entity_data_manager.cpp +++ b/singletons/entity_data_manager.cpp @@ -936,9 +936,15 @@ void EntityDataManager::load_entity_species_datas() { void EntityDataManager::request_entity_spawn(const Ref &info) { emit_signal("on_entity_spawn_requested", info); } +void EntityDataManager::request_entity_spawn_deferred(const Ref &info) { + call_deferred("emit_signal", "on_entity_spawn_requested", info); +} void EntityDataManager::request_world_spell_spawn(const Ref &data, const Ref &info) { emit_signal("on_world_spell_spawn_requested", data, info); } +void EntityDataManager::request_world_spell_spawn_deferred(const Ref &data, const Ref &info) { + call_deferred("emit_signal", "on_world_spell_spawn_requested", data, info); +} void EntityDataManager::_bind_methods() { ClassDB::bind_method(D_METHOD("get_skill_for_armor_type", "index"), &EntityDataManager::get_skill_for_armor_type); @@ -1088,7 +1094,9 @@ void EntityDataManager::_bind_methods() { ADD_SIGNAL(MethodInfo("on_world_spell_spawn_requested", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "WorldSpellData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); ClassDB::bind_method(D_METHOD("request_entity_spawn", "info"), &EntityDataManager::request_entity_spawn); + ClassDB::bind_method(D_METHOD("request_entity_spawn_deferred", "info"), &EntityDataManager::request_entity_spawn_deferred); ClassDB::bind_method(D_METHOD("request_world_spell_spawn", "data", "info"), &EntityDataManager::request_world_spell_spawn); + ClassDB::bind_method(D_METHOD("request_world_spell_spawn_deferred", "data", "info"), &EntityDataManager::request_world_spell_spawn_deferred); } EntityDataManager::EntityDataManager() { diff --git a/singletons/entity_data_manager.h b/singletons/entity_data_manager.h index 4a856f0..15ce516 100644 --- a/singletons/entity_data_manager.h +++ b/singletons/entity_data_manager.h @@ -175,7 +175,9 @@ public: void load_entity_species_datas(); void request_entity_spawn(const Ref &info); + void request_entity_spawn_deferred(const Ref &info); void request_world_spell_spawn(const Ref &data, const Ref &info); + void request_world_spell_spawn_deferred(const Ref &data, const Ref &info); EntityDataManager(); ~EntityDataManager();