mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-04-15 21:26:08 +02:00
Fix build for 4.0. (When 4.0 becomes stable I'll create a branch for it)
This commit is contained in:
parent
ed7bb5afa1
commit
9fa7c23462
@ -25,6 +25,8 @@ SOFTWARE.
|
||||
#include "../../entities/resources/entity_resource_cost_data.h"
|
||||
#include "../../singletons/entity_data_manager.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int Aura::get_id() const {
|
||||
return _id;
|
||||
}
|
||||
@ -1255,7 +1257,12 @@ void Aura::_supdate(Ref<AuraData> aura, float delta) {
|
||||
}
|
||||
|
||||
void Aura::_setup_aura_data(Ref<AuraData> data, Ref<AuraApplyInfo> info) {
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_caster()));
|
||||
#else
|
||||
ERR_FAIL_COND(info->get_caster() == NULL);
|
||||
#endif
|
||||
|
||||
data->set_aura(Ref<Aura>(this));
|
||||
data->set_aura_id(get_id());
|
||||
@ -1291,14 +1298,23 @@ void Aura::_calculate_initial_damage(Ref<AuraData> aura_data, Ref<AuraApplyInfo>
|
||||
}
|
||||
|
||||
void Aura::_handle_aura_damage(Ref<AuraData> aura_data, Ref<SpellDamageInfo> info) {
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_dealer()));
|
||||
#else
|
||||
ERR_FAIL_COND(info->get_dealer() == NULL);
|
||||
#endif
|
||||
|
||||
Math::randomize();
|
||||
|
||||
info->set_damage(_damage_min + (Math::rand() % (_damage_max = _damage_min)));
|
||||
info->set_damage_source_type(SpellDamageInfo::DAMAGE_SOURCE_AURA);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_dealer()));
|
||||
#else
|
||||
ERR_FAIL_COND(info->get_dealer() == NULL);
|
||||
#endif
|
||||
|
||||
info->get_dealer()->sdeal_damage_to(info);
|
||||
}
|
||||
@ -1316,14 +1332,22 @@ void Aura::_calculate_initial_heal(Ref<AuraData> aura_data, Ref<AuraApplyInfo> i
|
||||
}
|
||||
|
||||
void Aura::_handle_aura_heal(Ref<AuraData> aura_data, Ref<SpellHealInfo> info) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_dealer()));
|
||||
#else
|
||||
ERR_FAIL_COND(info->get_dealer() == NULL);
|
||||
#endif
|
||||
|
||||
Math::randomize();
|
||||
|
||||
info->set_heal(_heal_min + (Math::rand() % (_heal_max = _heal_min)));
|
||||
info->set_heal_source_type(SpellHealInfo::HEAL_SOURCE_AURA);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(info->get_dealer()));
|
||||
#else
|
||||
ERR_FAIL_COND(info->get_dealer() == NULL);
|
||||
#endif
|
||||
|
||||
info->get_dealer()->sdeal_heal_to(info);
|
||||
}
|
||||
|
@ -26,6 +26,12 @@ SOFTWARE.
|
||||
#include "../../entities/stats/stat.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
#define REAL FLOAT
|
||||
#endif
|
||||
|
||||
class ItemStatModifier : public Reference {
|
||||
GDCLASS(ItemStatModifier, Reference);
|
||||
|
||||
|
@ -27,6 +27,8 @@ SOFTWARE.
|
||||
#include "../spells/spell.h"
|
||||
#include "item_instance.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int ItemTemplate::get_id() const {
|
||||
return _id;
|
||||
}
|
||||
@ -176,7 +178,11 @@ void ItemTemplate::set_teaches_spell(const int index, const Ref<Spell> &spell) {
|
||||
Vector<Variant> ItemTemplate::get_teaches_spells() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _teaches_spells.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_teaches_spells[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_teaches_spells[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -212,7 +218,11 @@ void ItemTemplate::set_grants_spell(const int index, const Ref<Spell> &spell) {
|
||||
Vector<Variant> ItemTemplate::get_grants_spells() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _grants_spells.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_grants_spells[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_grants_spells[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -248,7 +258,11 @@ void ItemTemplate::set_aura(const int index, const Ref<Aura> &aura) {
|
||||
Vector<Variant> ItemTemplate::get_auras() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _auras.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_auras[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_auras[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -280,7 +294,11 @@ void ItemTemplate::set_required_skill(const int index, const Ref<Aura> &aura) {
|
||||
Vector<Variant> ItemTemplate::get_required_skills() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _required_skills.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_required_skills[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_required_skills[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -26,6 +26,12 @@ SOFTWARE.
|
||||
#include "../../entities/stats/stat.h"
|
||||
#include "core/reference.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
#define REAL FLOAT
|
||||
#endif
|
||||
|
||||
class ItemTemplateStatModifier : public Reference {
|
||||
GDCLASS(ItemTemplateStatModifier, Reference);
|
||||
|
||||
|
@ -25,6 +25,8 @@ SOFTWARE.
|
||||
#include "../auras/aura.h"
|
||||
#include "../spells/spell.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int EntitySpeciesData::get_id() const {
|
||||
return _id;
|
||||
}
|
||||
@ -81,7 +83,11 @@ int EntitySpeciesData::get_spell_count() const {
|
||||
Vector<Variant> EntitySpeciesData::get_spells() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _spells.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_spells[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_spells[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -122,7 +128,11 @@ int EntitySpeciesData::get_aura_count() const {
|
||||
Vector<Variant> EntitySpeciesData::get_auras() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _auras.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_auras[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_auras[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ SOFTWARE.
|
||||
|
||||
#include "species_model_data.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int SpeciesModelData::get_id() {
|
||||
return _id;
|
||||
}
|
||||
@ -73,7 +75,11 @@ Vector<Variant> SpeciesModelData::get_visuals(const int bone_index) {
|
||||
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _visuals[bone_index].size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_visuals[bone_index][i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_visuals[bone_index][i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -157,7 +163,11 @@ int SpeciesModelData::get_hair_style_count() const {
|
||||
Vector<Variant> SpeciesModelData::get_hair_styles() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _hair_styles.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_hair_styles[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_hair_styles[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -239,7 +249,11 @@ int SpeciesModelData::get_head_count() const {
|
||||
Vector<Variant> SpeciesModelData::get_heads() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _heads.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_heads[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_heads[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ SOFTWARE.
|
||||
#include "../../pipelines/spell_damage_info.h"
|
||||
#include "../../pipelines/spell_heal_info.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int Spell::get_id() const {
|
||||
return _id;
|
||||
}
|
||||
@ -204,7 +206,11 @@ void Spell::set_caster_aura_apply(const int index, const Ref<Aura> &caster_aura_
|
||||
Vector<Variant> Spell::get_caster_aura_applys() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _caster_aura_applys.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_caster_aura_applys[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_caster_aura_applys[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -240,7 +246,11 @@ void Spell::set_target_aura_apply(const int index, const Ref<Aura> &target_aura_
|
||||
Vector<Variant> Spell::get_target_aura_applys() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _target_aura_applys.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_target_aura_applys[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_target_aura_applys[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -276,7 +286,11 @@ void Spell::set_on_learn_aura(const int index, const Ref<Aura> &on_learn_aura_ap
|
||||
Vector<Variant> Spell::get_on_learn_auras() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _on_learn_auras.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_on_learn_auras[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_on_learn_auras[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -560,7 +574,11 @@ void Spell::set_training_required_skill_level(const int value) {
|
||||
//// Spell System ////
|
||||
|
||||
void Spell::sstart_casting_simple(Entity *caster, float spell_scale) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!caster || !ObjectDB::instance_validate(caster));
|
||||
#else
|
||||
ERR_FAIL_COND(!caster || caster == NULL);
|
||||
#endif
|
||||
|
||||
Ref<SpellCastInfo> info = Ref<SpellCastInfo>(memnew(SpellCastInfo()));
|
||||
|
||||
@ -575,7 +593,11 @@ void Spell::sstart_casting_simple(Entity *caster, float spell_scale) {
|
||||
}
|
||||
|
||||
void Spell::sinterrupt_cast_simple(Entity *caster) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!caster || !ObjectDB::instance_validate(caster));
|
||||
#else
|
||||
ERR_FAIL_COND(!caster || caster == NULL);
|
||||
#endif
|
||||
|
||||
Ref<SpellCastInfo> info(memnew(SpellCastInfo()));
|
||||
|
||||
@ -586,7 +608,11 @@ void Spell::sinterrupt_cast_simple(Entity *caster) {
|
||||
}
|
||||
|
||||
void Spell::sstart_casting_triggered_simple(Entity *caster) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!caster || !ObjectDB::instance_validate(caster));
|
||||
#else
|
||||
ERR_FAIL_COND(!caster || caster == NULL);
|
||||
#endif
|
||||
|
||||
Ref<SpellCastInfo> info(memnew(SpellCastInfo()));
|
||||
|
||||
@ -950,7 +976,12 @@ void Spell::_sfinish_cast(Ref<SpellCastInfo> info) {
|
||||
info->get_caster()->son_cast_finished(info);
|
||||
info->get_caster()->sspell_cast_success(info);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(info->get_target())) {
|
||||
#else
|
||||
if (info->get_target() != NULL) {
|
||||
#endif
|
||||
|
||||
info->get_target()->son_cast_finished_target(info);
|
||||
}
|
||||
|
||||
@ -1003,7 +1034,11 @@ void Spell::_handle_projectile(Ref<SpellCastInfo> info) {
|
||||
|
||||
Node *p = info->get_caster()->get_parent();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(p));
|
||||
#else
|
||||
ERR_FAIL_COND(p == NULL);
|
||||
#endif
|
||||
|
||||
p->add_child(projectile);
|
||||
|
||||
@ -1030,7 +1065,11 @@ void Spell::_handle_effect(Ref<SpellCastInfo> info) {
|
||||
# return
|
||||
*/
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
bool has_target = ObjectDB::instance_validate(info->get_target());
|
||||
#else
|
||||
bool has_target = info->get_target() == NULL;
|
||||
#endif
|
||||
|
||||
if (_target_type == SPELL_TARGET_TYPE_TARGET) {
|
||||
if (!has_target)
|
||||
|
@ -24,6 +24,8 @@ SOFTWARE.
|
||||
|
||||
#include "../entity.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
bool EntityAI::get_enabled() {
|
||||
return _enabled;
|
||||
}
|
||||
@ -98,26 +100,42 @@ String EntityAI::get_editor_description() const {
|
||||
}
|
||||
|
||||
void EntityAI::update(float delta) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_owner));
|
||||
#else
|
||||
ERR_FAIL_COND(_owner == NULL);
|
||||
#endif
|
||||
|
||||
if (has_method("_update"))
|
||||
call("_update", delta);
|
||||
}
|
||||
void EntityAI::pet_update(float delta) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_owner));
|
||||
#else
|
||||
ERR_FAIL_COND(_owner == NULL);
|
||||
#endif
|
||||
|
||||
if (has_method("_pet_update"))
|
||||
call("_pet_update", delta);
|
||||
}
|
||||
|
||||
void EntityAI::move(float delta) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_owner));
|
||||
#else
|
||||
ERR_FAIL_COND(_owner == NULL);
|
||||
#endif
|
||||
|
||||
if (has_method("_move"))
|
||||
call("_move", delta);
|
||||
}
|
||||
void EntityAI::pet_move(float delta) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_owner));
|
||||
#else
|
||||
ERR_FAIL_COND(_owner == NULL);
|
||||
#endif
|
||||
|
||||
if (has_method("_pet_move"))
|
||||
call("_pet_move", delta);
|
||||
|
@ -26,6 +26,8 @@ SOFTWARE.
|
||||
#include "../../singletons/entity_data_manager.h"
|
||||
#include "../entity.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
float AuraData::get_damage_count() {
|
||||
return _damage_already_taken;
|
||||
}
|
||||
@ -257,7 +259,11 @@ void AuraData::set_slow(float value) {
|
||||
}
|
||||
|
||||
void AuraData::resolve_references(Node *owner) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(owner));
|
||||
#else
|
||||
ERR_FAIL_COND(owner == NULL);
|
||||
#endif
|
||||
ERR_FAIL_COND(!owner->is_inside_tree());
|
||||
|
||||
_owner = Object::cast_to<Entity>(owner);
|
||||
|
@ -24,6 +24,8 @@ SOFTWARE.
|
||||
|
||||
#include "../../data/auras/aura.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int CharacterSpec::get_id() {
|
||||
return _id;
|
||||
}
|
||||
@ -52,7 +54,11 @@ void CharacterSpec::set_talent_row(const int index, const Ref<TalentRowData> row
|
||||
Vector<Variant> CharacterSpec::get_talent_rows() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _rows.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_rows[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_rows[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -30,6 +30,8 @@ SOFTWARE.
|
||||
#include "../entity.h"
|
||||
#include "character_spec.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int EntityClassData::get_id() {
|
||||
return _id;
|
||||
}
|
||||
@ -125,7 +127,11 @@ void EntityClassData::set_entity_resource(int index, Ref<EntityResourceData> ent
|
||||
Vector<Variant> EntityClassData::get_entity_resources() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _entity_resources.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_entity_resources[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_entity_resources[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -169,7 +175,11 @@ void EntityClassData::set_spec(int index, Ref<CharacterSpec> spec) {
|
||||
Vector<Variant> EntityClassData::get_specs() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _specs.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_specs[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_specs[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -213,7 +223,11 @@ void EntityClassData::set_spell(int index, Ref<Spell> spell) {
|
||||
Vector<Variant> EntityClassData::get_spells() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _spells.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_spells[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_spells[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -257,7 +271,11 @@ void EntityClassData::set_start_spell(int index, Ref<Spell> spell) {
|
||||
Vector<Variant> EntityClassData::get_start_spells() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _start_spells.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_start_spells[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_start_spells[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -301,7 +319,11 @@ void EntityClassData::set_aura(int index, Ref<Aura> aura) {
|
||||
Vector<Variant> EntityClassData::get_auras() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _auras.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_auras[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_auras[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -345,7 +367,11 @@ void EntityClassData::set_ai(int index, Ref<EntityAI> ai) {
|
||||
Vector<Variant> EntityClassData::get_ais() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _ais.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_ais[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_ais[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -622,7 +648,12 @@ void EntityClassData::son_xp_gained(Entity *entity, int value) {
|
||||
call("_son_xp_gained", entity, value);
|
||||
}
|
||||
void EntityClassData::son_xp_gained_bind(Node *entity, int value) {
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -636,7 +667,11 @@ void EntityClassData::son_class_level_up(Entity *entity, int value) {
|
||||
call("_son_class_level_up", entity);
|
||||
}
|
||||
void EntityClassData::son_class_level_up_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -650,7 +685,11 @@ void EntityClassData::son_character_level_up(Entity *entity, int value) {
|
||||
call("_son_character_level_up", entity);
|
||||
}
|
||||
void EntityClassData::son_character_level_up_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -824,7 +863,11 @@ void EntityClassData::con_xp_gained(Entity *entity, int value) {
|
||||
call("_con_xp_gained", entity, value);
|
||||
}
|
||||
void EntityClassData::con_xp_gained_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -838,7 +881,11 @@ void EntityClassData::con_class_level_up(Entity *entity, int value) {
|
||||
call("_con_class_level_up", entity);
|
||||
}
|
||||
void EntityClassData::con_class_level_up_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -852,7 +899,11 @@ void EntityClassData::con_character_level_up(Entity *entity, int value) {
|
||||
call("_con_character_level_up", entity);
|
||||
}
|
||||
void EntityClassData::con_character_level_up_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -881,7 +932,11 @@ bool EntityClassData::should_deny_equip(Entity *entity, ItemEnums::EquipSlots eq
|
||||
return false;
|
||||
}
|
||||
bool EntityClassData::should_deny_equip_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(entity), false);
|
||||
#else
|
||||
ERR_FAIL_COND_V(entity == NULL, false);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -895,7 +950,11 @@ void EntityClassData::son_equip_success(Entity *entity, ItemEnums::EquipSlots eq
|
||||
call("_son_equip_success", entity, equip_slot, item, old_item, bag_slot);
|
||||
}
|
||||
void EntityClassData::son_equip_success_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -909,7 +968,11 @@ void EntityClassData::son_equip_fail(Entity *entity, ItemEnums::EquipSlots equip
|
||||
call("_son_equip_fail", entity, equip_slot, item, old_item, bag_slot);
|
||||
}
|
||||
void EntityClassData::son_equip_fail_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -923,7 +986,11 @@ void EntityClassData::con_equip_success(Entity *entity, ItemEnums::EquipSlots eq
|
||||
call("_con_equip_success", entity, equip_slot, item, old_item, bag_slot);
|
||||
}
|
||||
void EntityClassData::con_equip_success_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -937,7 +1004,11 @@ void EntityClassData::con_equip_fail(Entity *entity, ItemEnums::EquipSlots equip
|
||||
call("_con_equip_fail", entity, equip_slot, item, old_item, bag_slot);
|
||||
}
|
||||
void EntityClassData::con_equip_fail_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
|
@ -30,6 +30,8 @@ SOFTWARE.
|
||||
#include "character_spec.h"
|
||||
#include "vendor_item_data.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int EntityData::get_id() const {
|
||||
return _id;
|
||||
}
|
||||
@ -213,7 +215,11 @@ void EntityData::set_craft_recipe(int index, const Ref<CraftRecipe> &craft_data)
|
||||
Vector<Variant> EntityData::get_craft_recipes() const {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _craft_recipes.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_craft_recipes[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_craft_recipes[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@ -266,7 +272,11 @@ String EntityData::generate_name() {
|
||||
//// SETUP ////
|
||||
|
||||
void EntityData::setup_resources(Entity *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
if (_entity_class_data.is_valid())
|
||||
_entity_class_data->setup_resources(entity);
|
||||
@ -276,7 +286,11 @@ void EntityData::setup_resources(Entity *entity) {
|
||||
}
|
||||
|
||||
bool EntityData::cans_interact(Entity *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(entity), false);
|
||||
#else
|
||||
ERR_FAIL_COND_V(entity == NULL, false);
|
||||
#endif
|
||||
|
||||
if (has_method("_cans_interact"))
|
||||
return call("_cans_interact", entity);
|
||||
@ -285,7 +299,11 @@ bool EntityData::cans_interact(Entity *entity) {
|
||||
}
|
||||
|
||||
bool EntityData::cans_interact_bind(Node *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(entity), false);
|
||||
#else
|
||||
ERR_FAIL_COND_V(entity == NULL, false);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -295,14 +313,22 @@ bool EntityData::cans_interact_bind(Node *entity) {
|
||||
}
|
||||
|
||||
void EntityData::sinteract(Entity *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
if (has_method("_sinteract"))
|
||||
call("_sinteract", entity);
|
||||
}
|
||||
|
||||
void EntityData::sinteract_bind(Node *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -605,7 +631,11 @@ void EntityData::son_xp_gained(Entity *entity, int value) {
|
||||
call("_son_xp_gained", entity, value);
|
||||
}
|
||||
void EntityData::son_xp_gained_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -622,7 +652,11 @@ void EntityData::son_class_level_up(Entity *entity, int value) {
|
||||
call("_son_class_level_up", entity);
|
||||
}
|
||||
void EntityData::son_class_level_up_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -639,7 +673,11 @@ void EntityData::son_character_level_up(Entity *entity, int value) {
|
||||
call("_son_character_level_up", entity);
|
||||
}
|
||||
void EntityData::son_character_level_up_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -880,7 +918,11 @@ void EntityData::con_xp_gained(Entity *entity, int value) {
|
||||
call("_con_xp_gained", entity, value);
|
||||
}
|
||||
void EntityData::con_xp_gained_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -897,7 +939,11 @@ void EntityData::con_class_level_up(Entity *entity, int value) {
|
||||
call("_con_class_level_up", entity);
|
||||
}
|
||||
void EntityData::con_class_level_up_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -914,7 +960,11 @@ void EntityData::con_character_level_up(Entity *entity, int value) {
|
||||
call("_con_character_level_up", entity);
|
||||
}
|
||||
void EntityData::con_character_level_up_bind(Node *entity, int value) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -955,7 +1005,11 @@ bool EntityData::should_deny_equip(Entity *entity, ItemEnums::EquipSlots equip_s
|
||||
return false;
|
||||
}
|
||||
bool EntityData::should_deny_equip_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(entity), false);
|
||||
#else
|
||||
ERR_FAIL_COND_V(entity == NULL, false);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -972,7 +1026,11 @@ void EntityData::son_equip_success(Entity *entity, ItemEnums::EquipSlots equip_s
|
||||
call("_son_equip_success", entity, equip_slot, item, old_item, bag_slot);
|
||||
}
|
||||
void EntityData::son_equip_success_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -989,7 +1047,11 @@ void EntityData::son_equip_fail(Entity *entity, ItemEnums::EquipSlots equip_slot
|
||||
call("_son_equip_fail", entity, equip_slot, item, old_item, bag_slot);
|
||||
}
|
||||
void EntityData::son_equip_fail_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -1006,7 +1068,11 @@ void EntityData::con_equip_success(Entity *entity, ItemEnums::EquipSlots equip_s
|
||||
call("_con_equip_success", entity, equip_slot, item, old_item, bag_slot);
|
||||
}
|
||||
void EntityData::con_equip_success_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
@ -1023,7 +1089,11 @@ void EntityData::con_equip_fail(Entity *entity, ItemEnums::EquipSlots equip_slot
|
||||
call("_con_equip_fail", entity, equip_slot, item, old_item, bag_slot);
|
||||
}
|
||||
void EntityData::con_equip_fail_bind(Node *entity, ItemEnums::EquipSlots equip_slot, Ref<ItemInstance> item, Ref<ItemInstance> old_item, int bag_slot) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
Entity *e = Object::cast_to<Entity>(entity);
|
||||
|
||||
|
@ -22,6 +22,8 @@ SOFTWARE.
|
||||
|
||||
#include "item_container_data.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int ItemContainerData::get_num_container_datas() {
|
||||
return _container_datas.size();
|
||||
}
|
||||
@ -43,7 +45,11 @@ void ItemContainerData::set_container_data(int index, Ref<ItemContainerDataEntry
|
||||
Vector<Variant> ItemContainerData::get_container_datas() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _container_datas.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_container_datas[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_container_datas[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ SOFTWARE.
|
||||
|
||||
#include "vendor_item_data.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
int VendorItemData::get_num_vendor_datas() {
|
||||
return _vendor_datas.size();
|
||||
}
|
||||
@ -40,7 +42,11 @@ void VendorItemData::set_vendor_data(int index, Ref<VendorItemDataEntry> vendor_
|
||||
Vector<Variant> VendorItemData::get_vendor_datas() {
|
||||
Vector<Variant> r;
|
||||
for (int i = 0; i < _vendor_datas.size(); i++) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r.push_back(_vendor_datas[i].get_ref_ptr());
|
||||
#else
|
||||
r.push_back(_vendor_datas[i]);
|
||||
#endif
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -39,6 +39,8 @@ SOFTWARE.
|
||||
|
||||
#include "core/script_language.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
NodePath Entity::get_body_path() {
|
||||
return _body_path;
|
||||
}
|
||||
@ -47,8 +49,13 @@ void Entity::set_body_path(NodePath value) {
|
||||
|
||||
_body = get_node_or_null(_body_path);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(_body))
|
||||
_body->set_owner(this);
|
||||
#else
|
||||
if (_body == NULL)
|
||||
_body->set_owner(this);
|
||||
#endif
|
||||
}
|
||||
Node *Entity::get_body() {
|
||||
return _body;
|
||||
@ -123,12 +130,20 @@ void Entity::setc_entity_type(EntityEnums::EntityType value) {
|
||||
EntityEnums::EntityRelationType Entity::gets_relation_to_bind(Node *to) {
|
||||
Entity *e = Object::cast_to<Entity>(to);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(e), EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||
#else
|
||||
ERR_FAIL_COND_V(e == NULL, EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||
#endif
|
||||
|
||||
return gets_relation_to(e);
|
||||
}
|
||||
EntityEnums::EntityRelationType Entity::gets_relation_to(Entity *to) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(to), EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||
#else
|
||||
ERR_FAIL_COND_V(to == NULL, EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||
#endif
|
||||
|
||||
return static_cast<EntityEnums::EntityRelationType>(static_cast<int>(call("_gets_relation_to", to)));
|
||||
}
|
||||
@ -143,12 +158,21 @@ EntityEnums::EntityRelationType Entity::_gets_relation_to(Node *to) {
|
||||
EntityEnums::EntityRelationType Entity::getc_relation_to_bind(Node *to) {
|
||||
Entity *e = Object::cast_to<Entity>(to);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(e), EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||
#else
|
||||
ERR_FAIL_COND_V(e == NULL, EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||
#endif
|
||||
|
||||
return getc_relation_to(e);
|
||||
}
|
||||
EntityEnums::EntityRelationType Entity::getc_relation_to(Entity *to) {
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(to), EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||
#else
|
||||
ERR_FAIL_COND_V(to == NULL, EntityEnums::ENTITY_RELATION_TYPE_NEUTRAL);
|
||||
#endif
|
||||
|
||||
return static_cast<EntityEnums::EntityRelationType>(static_cast<int>(call("_getc_relation_to", to)));
|
||||
}
|
||||
@ -235,7 +259,12 @@ EntityEnums::EntityGender Entity::getc_gender() {
|
||||
void Entity::setc_gender(EntityEnums::EntityGender value) {
|
||||
_c_gender = value;
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(_character_skeleton)) {
|
||||
#else
|
||||
if (_character_skeleton != NULL) {
|
||||
#endif
|
||||
|
||||
if (_character_skeleton->has_method("set_gender"))
|
||||
_character_skeleton->call("set_gender", _c_gender);
|
||||
}
|
||||
@ -642,7 +671,7 @@ void Entity::setup_actionbars() {
|
||||
return;
|
||||
}
|
||||
|
||||
ProfileManager *pm = ProfileManager::get_instance();
|
||||
//ProfileManager *pm = ProfileManager::get_instance();
|
||||
|
||||
//if (pm != NULL) {
|
||||
// Ref<ClassProfile> cp = pm->get_class_profile(gets_entity_data()->get_id());
|
||||
@ -744,7 +773,11 @@ void Entity::sets_ai(Ref<EntityAI> value) {
|
||||
//// Pets ////
|
||||
|
||||
void Entity::adds_pet(Entity *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
//the owner always want to see his pet, and you pet will always want to see the owner
|
||||
adds_sees(entity);
|
||||
@ -786,12 +819,20 @@ void Entity::removes_pet_index(int index) {
|
||||
for (int i = 0; i < _s_pets.size(); ++i) {
|
||||
Entity *pet = _s_pets.get(index);
|
||||
|
||||
ERR_CONTINUE(!ObjectDB::instance_validate(entity));
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_CONTINUE(!ObjectDB::instance_validate(pet));
|
||||
#else
|
||||
ERR_CONTINUE(pet == NULL);
|
||||
#endif
|
||||
|
||||
_s_pets.get(i)->sets_pet_formation_index(i);
|
||||
}
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
entity->sets_pet_owner(NULL);
|
||||
|
||||
@ -824,13 +865,21 @@ void Entity::addc_pet_path(NodePath path) {
|
||||
|
||||
Entity *entity = Object::cast_to<Entity>(n);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
addc_pet(entity);
|
||||
}
|
||||
|
||||
void Entity::addc_pet(Entity *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
_c_pets.push_back(entity);
|
||||
|
||||
@ -851,11 +900,15 @@ Entity *Entity::getc_pet(int index) {
|
||||
void Entity::removec_pet_index(int index) {
|
||||
ERR_FAIL_INDEX(index, _c_pets.size());
|
||||
|
||||
Entity *entity = _c_pets.get(index);
|
||||
//Entity *entity = _c_pets.get(index);
|
||||
|
||||
_c_pets.remove(index);
|
||||
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
//#if VERSION_MAJOR < 4
|
||||
//ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
//#else
|
||||
//ERR_FAIL_COND(entity == NULL);
|
||||
//#endif
|
||||
|
||||
//full callback stack spet_added
|
||||
}
|
||||
@ -1991,7 +2044,12 @@ void Entity::_capply_item(Ref<ItemInstance> item) {
|
||||
|
||||
ERR_FAIL_COND(!it.is_valid());
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (it->get_item_visual().is_valid() && ObjectDB::instance_validate(_character_skeleton)) {
|
||||
#else
|
||||
if (it->get_item_visual().is_valid() && _character_skeleton == NULL) {
|
||||
#endif
|
||||
|
||||
if (_character_skeleton->has_method("add_item_visual"))
|
||||
_character_skeleton->call("add_item_visual", it->get_item_visual());
|
||||
}
|
||||
@ -2003,7 +2061,12 @@ void Entity::_cdeapply_item(Ref<ItemInstance> item) {
|
||||
|
||||
ERR_FAIL_COND(!it.is_valid());
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (it->get_item_visual().is_valid() && ObjectDB::instance_validate(_character_skeleton)) {
|
||||
#else
|
||||
if (it->get_item_visual().is_valid() && _character_skeleton == NULL) {
|
||||
#endif
|
||||
|
||||
if (_character_skeleton->has_method("remove_item_visual"))
|
||||
_character_skeleton->call("remove_item_visual", it->get_item_visual());
|
||||
}
|
||||
@ -2382,7 +2445,12 @@ bool Entity::canc_interact() {
|
||||
return call("_canc_interact");
|
||||
}
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (!ObjectDB::instance_validate(_c_target)) {
|
||||
#else
|
||||
if (_c_target == NULL) {
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -3500,7 +3568,12 @@ Ref<AuraData> Entity::gets_aura_with_group_by(Entity *caster, Ref<AuraGroup> aur
|
||||
return Ref<AuraData>();
|
||||
}
|
||||
Ref<AuraData> Entity::gets_aura_with_group_by_bind(Node *caster, Ref<AuraGroup> aura_group) {
|
||||
#if VERSION_MAJOR < 4
|
||||
if (!ObjectDB::instance_validate(caster)) {
|
||||
#else
|
||||
if (caster == NULL) {
|
||||
#endif
|
||||
|
||||
return Ref<AuraData>();
|
||||
}
|
||||
|
||||
@ -4605,8 +4678,13 @@ void Entity::adds_skill(Ref<EntitySkill> skill) {
|
||||
if (hass_skill(skill))
|
||||
return;
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
skill->connect("current_changed", this, "sskill_current_changed");
|
||||
skill->connect("max_changed", this, "sskill_max_changed");
|
||||
#else
|
||||
skill->connect("current_changed", callable_mp(this, &Entity::sskill_current_changed));
|
||||
skill->connect("max_changed", callable_mp(this, &Entity::sskill_max_changed));
|
||||
#endif
|
||||
|
||||
_s_skills.push_back(skill);
|
||||
|
||||
@ -4832,7 +4910,12 @@ Entity *Entity::gets_target() {
|
||||
void Entity::sets_target(Node *p_target) {
|
||||
Entity *original_target = _s_target;
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (!ObjectDB::instance_validate(original_target)) {
|
||||
#else
|
||||
if (original_target == NULL) {
|
||||
#endif
|
||||
|
||||
original_target = NULL;
|
||||
_s_target = NULL;
|
||||
}
|
||||
@ -4882,7 +4965,12 @@ Entity *Entity::getc_target() {
|
||||
void Entity::setc_target(Node *p_target) {
|
||||
Entity *original_target = _c_target;
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (!ObjectDB::instance_validate(original_target)) {
|
||||
#else
|
||||
if (original_target == NULL) {
|
||||
#endif
|
||||
|
||||
original_target = NULL;
|
||||
_c_target = NULL;
|
||||
}
|
||||
@ -5152,23 +5240,41 @@ Ref<Bag> Entity::gets_bag() const {
|
||||
}
|
||||
void Entity::sets_bag(const Ref<Bag> bag) {
|
||||
if (_s_bag.is_valid()) {
|
||||
#if VERSION_MAJOR < 4
|
||||
_s_bag->disconnect("item_added", this, "ons_item_added");
|
||||
_s_bag->disconnect("item_removed", this, "ons_item_removed");
|
||||
_s_bag->disconnect("item_swapped", this, "ons_items_swapped");
|
||||
_s_bag->disconnect("item_count_changed", this, "ons_item_count_changed");
|
||||
_s_bag->disconnect("overburdened", this, "ons_overburdened");
|
||||
_s_bag->disconnect("overburden_removed", this, "ons_overburden_removed");
|
||||
#else
|
||||
_s_bag->disconnect("item_added", callable_mp(this, &Entity::ons_item_added));
|
||||
_s_bag->disconnect("item_removed", callable_mp(this, &Entity::ons_item_removed));
|
||||
_s_bag->disconnect("item_swapped", callable_mp(this, &Entity::ons_items_swapped));
|
||||
_s_bag->disconnect("item_count_changed", callable_mp(this, &Entity::ons_item_count_changed));
|
||||
_s_bag->disconnect("overburdened", callable_mp(this, &Entity::ons_overburdened));
|
||||
_s_bag->disconnect("overburden_removed", callable_mp(this, &Entity::ons_overburden_removed));
|
||||
#endif
|
||||
}
|
||||
|
||||
_s_bag = bag;
|
||||
|
||||
if (_s_bag.is_valid()) {
|
||||
#if VERSION_MAJOR < 4
|
||||
_s_bag->connect("item_added", this, "ons_item_added");
|
||||
_s_bag->connect("item_removed", this, "ons_item_removed");
|
||||
_s_bag->connect("item_swapped", this, "ons_items_swapped");
|
||||
_s_bag->connect("item_count_changed", this, "ons_item_count_changed");
|
||||
_s_bag->connect("overburdened", this, "ons_overburdened");
|
||||
_s_bag->connect("overburden_removed", this, "ons_overburden_removed");
|
||||
#else
|
||||
_s_bag->connect("item_added", callable_mp(this, &Entity::ons_item_added));
|
||||
_s_bag->connect("item_removed", callable_mp(this, &Entity::ons_item_removed));
|
||||
_s_bag->connect("item_swapped", callable_mp(this, &Entity::ons_items_swapped));
|
||||
_s_bag->connect("item_count_changed", callable_mp(this, &Entity::ons_item_count_changed));
|
||||
_s_bag->connect("overburdened", callable_mp(this, &Entity::ons_overburdened));
|
||||
_s_bag->connect("overburden_removed", callable_mp(this, &Entity::ons_overburden_removed));
|
||||
#endif
|
||||
}
|
||||
|
||||
emit_signal("sbag_changed", this, _s_bag);
|
||||
@ -5194,19 +5300,33 @@ Ref<Bag> Entity::gets_target_bag() const {
|
||||
}
|
||||
void Entity::sets_target_bag(const Ref<Bag> bag) {
|
||||
if (_s_target_bag.is_valid()) {
|
||||
#if VERSION_MAJOR < 4
|
||||
_s_target_bag->disconnect("item_added", this, "ons_target_item_added");
|
||||
_s_target_bag->disconnect("item_removed", this, "ons_target_item_removed");
|
||||
_s_target_bag->disconnect("item_swapped", this, "ons_target_items_swapped");
|
||||
_s_target_bag->disconnect("item_count_changed", this, "ons_target_item_count_changed");
|
||||
#else
|
||||
_s_target_bag->disconnect("item_added", callable_mp(this, &Entity::ons_target_item_added));
|
||||
_s_target_bag->disconnect("item_removed", callable_mp(this, &Entity::ons_target_item_removed));
|
||||
_s_target_bag->disconnect("item_swapped", callable_mp(this, &Entity::ons_target_items_swapped));
|
||||
_s_target_bag->disconnect("item_count_changed", callable_mp(this, &Entity::ons_target_item_count_changed));
|
||||
#endif
|
||||
}
|
||||
|
||||
_s_target_bag = bag;
|
||||
|
||||
if (_s_target_bag.is_valid()) {
|
||||
#if VERSION_MAJOR < 4
|
||||
_s_target_bag->connect("item_added", this, "ons_target_item_added");
|
||||
_s_target_bag->connect("item_removed", this, "ons_target_item_removed");
|
||||
_s_target_bag->connect("item_swapped", this, "ons_target_items_swapped");
|
||||
_s_target_bag->connect("item_count_changed", this, "ons_target_item_count_changed");
|
||||
#else
|
||||
_s_target_bag->connect("item_added", callable_mp(this, &Entity::ons_target_item_added));
|
||||
_s_target_bag->connect("item_removed", callable_mp(this, &Entity::ons_target_item_removed));
|
||||
_s_target_bag->connect("item_swapped", callable_mp(this, &Entity::ons_target_items_swapped));
|
||||
_s_target_bag->connect("item_count_changed", callable_mp(this, &Entity::ons_target_item_count_changed));
|
||||
#endif
|
||||
}
|
||||
|
||||
emit_signal("starget_bag_changed", this, _s_target_bag);
|
||||
@ -5602,7 +5722,12 @@ Entity *Entity::gets_sees(int index) {
|
||||
void Entity::removes_sees_index(int index) {
|
||||
Entity *e = _s_sees.get(index);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (unlikely(!ObjectDB::instance_validate(e))) {
|
||||
#else
|
||||
if (e == NULL) {
|
||||
#endif
|
||||
|
||||
_s_sees.remove(index);
|
||||
return;
|
||||
}
|
||||
@ -5612,7 +5737,12 @@ void Entity::removes_sees_index(int index) {
|
||||
_s_sees.remove(index);
|
||||
}
|
||||
void Entity::removes_sees(Entity *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
if (unlikely(!ObjectDB::instance_validate(entity))) {
|
||||
#else
|
||||
if (entity == NULL) {
|
||||
#endif
|
||||
|
||||
_s_sees.erase(entity);
|
||||
return;
|
||||
}
|
||||
@ -5629,7 +5759,11 @@ void Entity::removes_sees_bind(Node *entity) {
|
||||
removes_sees(e);
|
||||
}
|
||||
void Entity::adds_sees(Entity *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
entity->adds_seen_by(this);
|
||||
|
||||
@ -5670,7 +5804,11 @@ void Entity::removes_seen_by_bind(Node *entity) {
|
||||
removes_seen_by(e);
|
||||
}
|
||||
void Entity::adds_seen_by(Entity *entity) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(entity));
|
||||
#else
|
||||
ERR_FAIL_COND(entity == NULL);
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < _s_seen_by.size(); ++i) {
|
||||
if (_s_seen_by.get(i) == entity)
|
||||
@ -5705,7 +5843,12 @@ void Entity::vrpc(const StringName &p_method, VARIANT_ARG_DECLARE) {
|
||||
for (int i = 0; i < _s_seen_by.size(); ++i) {
|
||||
Entity *e = _s_seen_by.get(i);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (unlikely(!ObjectDB::instance_validate(e))) {
|
||||
#else
|
||||
if (e == NULL) {
|
||||
#endif
|
||||
|
||||
_s_seen_by.remove(i);
|
||||
--i;
|
||||
continue;
|
||||
@ -5721,16 +5864,30 @@ void Entity::vrpc(const StringName &p_method, VARIANT_ARG_DECLARE) {
|
||||
rpcp(get_network_master(), false, p_method, argptr, argc);
|
||||
}
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Variant Entity::_vrpc_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
|
||||
#else
|
||||
Variant Entity::_vrpc_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
|
||||
#endif
|
||||
|
||||
if (p_argcount < 1) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
|
||||
#else
|
||||
r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
|
||||
#endif
|
||||
|
||||
r_error.argument = 1;
|
||||
return Variant();
|
||||
}
|
||||
|
||||
if (p_args[0]->get_type() != Variant::STRING) {
|
||||
#if VERSION_MAJOR < 4
|
||||
r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
#else
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
#endif
|
||||
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::STRING;
|
||||
return Variant();
|
||||
@ -5741,7 +5898,12 @@ Variant Entity::_vrpc_bind(const Variant **p_args, int p_argcount, Variant::Call
|
||||
for (int i = 0; i < _s_seen_by.size(); ++i) {
|
||||
Entity *e = _s_seen_by.get(i);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (unlikely(!ObjectDB::instance_validate(e))) {
|
||||
#else
|
||||
if (unlikely(e == NULL)) {
|
||||
#endif
|
||||
|
||||
_s_seen_by.remove(i);
|
||||
--i;
|
||||
continue;
|
||||
@ -5755,7 +5917,12 @@ Variant Entity::_vrpc_bind(const Variant **p_args, int p_argcount, Variant::Call
|
||||
|
||||
//call(method, &p_args[1], p_argcount - 1);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
r_error.error = Variant::CallError::CALL_OK;
|
||||
#else
|
||||
r_error.error = Callable::CallError::CALL_OK;
|
||||
#endif
|
||||
|
||||
return Variant();
|
||||
}
|
||||
|
||||
@ -6241,13 +6408,21 @@ void Entity::_moved() {
|
||||
}
|
||||
|
||||
void Entity::_con_target_changed(Node *p_entity, Node *p_old_target) {
|
||||
Entity *entity = Object::cast_to<Entity>(p_entity);
|
||||
//Entity *entity = Object::cast_to<Entity>(p_entity);
|
||||
Entity *old_target = Object::cast_to<Entity>(p_old_target);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(old_target))
|
||||
old_target->onc_untargeted();
|
||||
|
||||
if (ObjectDB::instance_validate(getc_target())) {
|
||||
#else
|
||||
if (old_target != NULL)
|
||||
old_target->onc_untargeted();
|
||||
|
||||
if (getc_target() != NULL) {
|
||||
#endif
|
||||
|
||||
getc_target()->onc_targeted();
|
||||
|
||||
if (canc_interact())
|
||||
@ -6297,8 +6472,9 @@ void Entity::_son_death() {
|
||||
}
|
||||
|
||||
void Entity::_slearn_spell(int id) {
|
||||
if (EntityDataManager::get_instance()->get_use_spell_points())
|
||||
if (EntityDataManager::get_instance()->get_use_spell_points()) {
|
||||
ERR_FAIL_COND(gets_free_spell_points() <= 0);
|
||||
}
|
||||
|
||||
ERR_FAIL_COND(!_s_entity_data.is_valid());
|
||||
|
||||
@ -6334,8 +6510,13 @@ void Entity::_notification(int p_what) {
|
||||
case NOTIFICATION_INSTANCED: {
|
||||
_body = get_node_or_null(_body_path);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(_body))
|
||||
_body->set_owner(this);
|
||||
#else
|
||||
if (_body != NULL)
|
||||
_body->set_owner(this);
|
||||
#endif
|
||||
|
||||
_character_skeleton = get_node_or_null(_character_skeleton_path);
|
||||
|
||||
@ -6351,8 +6532,13 @@ void Entity::_notification(int p_what) {
|
||||
if (!_body) {
|
||||
_body = get_node_or_null(_body_path);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(_body))
|
||||
_body->set_owner(this);
|
||||
#else
|
||||
if (_body != NULL)
|
||||
_body->set_owner(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!_character_skeleton) {
|
||||
@ -6375,9 +6561,13 @@ void Entity::_notification(int p_what) {
|
||||
for (int i = 0; i < _s_seen_by.size(); ++i) {
|
||||
Entity *e = _s_seen_by.get(i);
|
||||
|
||||
if (ObjectDB::instance_validate(e)) {
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(e))
|
||||
e->removes_sees(this);
|
||||
}
|
||||
#else
|
||||
if (e != NULL)
|
||||
e->removes_sees(this);
|
||||
#endif
|
||||
}
|
||||
} break;
|
||||
}
|
||||
|
@ -56,6 +56,8 @@ SOFTWARE.
|
||||
|
||||
#include "../data/auras/aura_group.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
class EntityData;
|
||||
class AuraData;
|
||||
class Spell;
|
||||
@ -970,7 +972,12 @@ public:
|
||||
int gets_seen_by_count();
|
||||
|
||||
void vrpc(const StringName &p_method, VARIANT_ARG_LIST);
|
||||
#if VERSION_MAJOR < 4
|
||||
Variant _vrpc_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
|
||||
#else
|
||||
Variant _vrpc_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
|
||||
#endif
|
||||
|
||||
|
||||
Dictionary data_as_dict(String &data);
|
||||
|
||||
|
@ -25,6 +25,8 @@ SOFTWARE.
|
||||
#include "../entity.h"
|
||||
#include "stat_data_entry.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
const String Stat::STAT_BINDING_STRING = "Health,Speed,Mana,GCD,Haste,Agility,Strength,Stamina,Intellect,Spirit,Haste Rating,Resilience,Armor,Attack Power,Spell Power,Melee Crit,Melee Crit bonus,Spell Crit,Spell Crit Bonus,Block,Parry,Damage Reduction,Melee Damage Reduction,Spell Damage Reduction,Damage Taken,Heal Taken,Melee Damage,Spell Damage,Holy Resist,Shadow Resist,Nature Resist,Fire Resist,Frost Resist,Lightning Resist,Chaos Resist,Silence Resist,Fear Resist,Stun Resist,Energy,Rage,XP Rate,None";
|
||||
const String Stat::MAIN_STAT_BINDING_STRING = "Agility,Strength,Stamina,Intellect,Spirit";
|
||||
|
||||
@ -327,7 +329,11 @@ void Stat::remove_modifier_index(int index) {
|
||||
}
|
||||
|
||||
void Stat::apply_modifiers() {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_owner));
|
||||
#else
|
||||
ERR_FAIL_COND(_owner == NULL);
|
||||
#endif
|
||||
ERR_FAIL_COND(!_stat_data_entry.is_valid());
|
||||
|
||||
reset_values();
|
||||
|
@ -22,6 +22,12 @@ SOFTWARE.
|
||||
|
||||
#include "stat_data_entry.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
#define REAL FLOAT
|
||||
#endif
|
||||
|
||||
Stat::StatId StatDataEntry::get_stat_id() {
|
||||
return _stat_id;
|
||||
}
|
||||
|
@ -24,6 +24,12 @@ SOFTWARE.
|
||||
|
||||
#include "stat.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
#define REAL FLOAT
|
||||
#endif
|
||||
|
||||
Ref<Stat> StatModifier::get_owner() {
|
||||
return Ref<Stat>(_owner);
|
||||
}
|
||||
|
@ -24,6 +24,8 @@ SOFTWARE.
|
||||
|
||||
#include "../entities/entity.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
void AIFormation::set_owner(Entity *entity) {
|
||||
_owner = entity;
|
||||
|
||||
@ -60,7 +62,12 @@ String AIFormation::get_editor_description() const {
|
||||
}
|
||||
|
||||
Vector3 AIFormation::get_position(int slot_index) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND_V(!ObjectDB::instance_validate(_owner), Vector3());
|
||||
#else
|
||||
ERR_FAIL_COND_V(_owner == NULL, Vector3());
|
||||
#endif
|
||||
|
||||
|
||||
if (has_method("_get_position"))
|
||||
return call("_get_position", slot_index);
|
||||
|
@ -28,12 +28,16 @@ SOFTWARE.
|
||||
#include "../entities/entity.h"
|
||||
#include "../singletons/entity_data_manager.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
//// SpellCastInfo ////
|
||||
|
||||
Entity *SpellCastInfo::get_caster() {
|
||||
#if VERSION_MAJOR < 4
|
||||
if (_caster && !ObjectDB::instance_validate(_caster)) {
|
||||
_caster = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
return _caster;
|
||||
}
|
||||
@ -55,9 +59,12 @@ void SpellCastInfo::set_caster_bind(Node *caster) {
|
||||
}
|
||||
|
||||
Entity *SpellCastInfo::get_target() {
|
||||
#if VERSION_MAJOR < 4
|
||||
if (_target && !ObjectDB::instance_validate(_target)) {
|
||||
_target = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return _target;
|
||||
}
|
||||
@ -160,7 +167,12 @@ void SpellCastInfo::physics_process(float delta) {
|
||||
}
|
||||
|
||||
void SpellCastInfo::resolve_references(Node *owner) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(owner));
|
||||
#else
|
||||
ERR_FAIL_COND(owner == NULL);
|
||||
#endif
|
||||
|
||||
ERR_FAIL_COND(!owner->is_inside_tree());
|
||||
|
||||
_caster = Object::cast_to<Entity>(owner);
|
||||
@ -179,11 +191,19 @@ void SpellCastInfo::resolve_references(Node *owner) {
|
||||
Dictionary SpellCastInfo::to_dict() {
|
||||
Dictionary dict;
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(_caster))
|
||||
dict["caster"] = _caster->get_path();
|
||||
|
||||
if (ObjectDB::instance_validate(_target))
|
||||
dict["target"] = _target->get_path();
|
||||
#else
|
||||
if (_caster == NULL)
|
||||
dict["caster"] = _caster->get_path();
|
||||
|
||||
if (_target == NULL)
|
||||
dict["target"] = _target->get_path();
|
||||
#endif
|
||||
|
||||
dict["has_cast_time"] = _has_cast_time;
|
||||
dict["cast_time"] = _cast_time;
|
||||
|
@ -27,6 +27,8 @@ SOFTWARE.
|
||||
#include "../entities/entity.h"
|
||||
#include "../singletons/entity_data_manager.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
bool SpellDamageInfo::get_immune() {
|
||||
return _crit;
|
||||
}
|
||||
@ -162,7 +164,11 @@ void SpellDamageInfo::reset() {
|
||||
}
|
||||
|
||||
void SpellDamageInfo::resolve_references(Node *owner) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(owner));
|
||||
#else
|
||||
ERR_FAIL_COND(owner == NULL);
|
||||
#endif
|
||||
ERR_FAIL_COND(!owner->is_inside_tree());
|
||||
|
||||
_dealer = Object::cast_to<Entity>(owner->get_node_or_null(_dealer_path));
|
||||
@ -178,11 +184,19 @@ void SpellDamageInfo::resolve_references(Node *owner) {
|
||||
Dictionary SpellDamageInfo::to_dict() {
|
||||
Dictionary dict;
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(_dealer))
|
||||
dict["dealer_path"] = _dealer->get_path();
|
||||
|
||||
if (ObjectDB::instance_validate(_receiver))
|
||||
dict["receiver_path"] = _receiver->get_path();
|
||||
#else
|
||||
if (_dealer != NULL)
|
||||
dict["dealer_path"] = _dealer->get_path();
|
||||
|
||||
if (_receiver != NULL)
|
||||
dict["receiver_path"] = _receiver->get_path();
|
||||
#endif
|
||||
|
||||
dict["immune"] = _immune;
|
||||
dict["damage"] = _damage;
|
||||
|
@ -27,6 +27,8 @@ SOFTWARE.
|
||||
#include "../entities/entity.h"
|
||||
#include "../singletons/entity_data_manager.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
bool SpellHealInfo::get_immune() {
|
||||
return _immune;
|
||||
}
|
||||
@ -158,7 +160,11 @@ void SpellHealInfo::reset() {
|
||||
}
|
||||
|
||||
void SpellHealInfo::resolve_references(Node *owner) {
|
||||
#if VERSION_MAJOR < 4
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(owner));
|
||||
#else
|
||||
ERR_FAIL_COND(owner == NULL);
|
||||
#endif
|
||||
ERR_FAIL_COND(!owner->is_inside_tree());
|
||||
|
||||
_dealer = Object::cast_to<Entity>(owner->get_node_or_null(_dealer_path));
|
||||
@ -174,11 +180,19 @@ void SpellHealInfo::resolve_references(Node *owner) {
|
||||
Dictionary SpellHealInfo::to_dict() {
|
||||
Dictionary dict;
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
if (ObjectDB::instance_validate(_dealer))
|
||||
dict["dealer_path"] = _dealer->get_path();
|
||||
|
||||
if (ObjectDB::instance_validate(_receiver))
|
||||
dict["receiver_path"] = _receiver->get_path();
|
||||
#else
|
||||
if (_dealer == NULL)
|
||||
dict["dealer_path"] = _dealer->get_path();
|
||||
|
||||
if (_receiver == NULL)
|
||||
dict["receiver_path"] = _receiver->get_path();
|
||||
#endif
|
||||
|
||||
dict["immune"] = _immune;
|
||||
dict["heal"] = _heal;
|
||||
|
@ -24,6 +24,12 @@ SOFTWARE.
|
||||
|
||||
#include "action_bar_profile.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
#define REAL FLOAT
|
||||
#endif
|
||||
|
||||
Ref<ActionBarProfile> ActionBarEntry::get_owner() {
|
||||
return Ref<ActionBarProfile>(_owner);
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ SOFTWARE.
|
||||
|
||||
#include "player_profile.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
const String PlayerProfile::DEFAULT_PROFILE_FILE_NAME = "default.profile";
|
||||
|
||||
int PlayerProfile::get_id() {
|
||||
@ -59,7 +61,11 @@ Ref<ClassProfile> PlayerProfile::get_class_profile_index(const int index) {
|
||||
}
|
||||
|
||||
void PlayerProfile::add_class_profile(Ref<ClassProfile> profile) {
|
||||
#if VERSION_MAJOR < 4
|
||||
profile->connect("changed", this, "_on_class_profile_changed");
|
||||
#else
|
||||
profile->connect("changed", callable_mp(this, &PlayerProfile::_on_class_profile_changed));
|
||||
#endif
|
||||
|
||||
_class_profiles.push_back(profile);
|
||||
|
||||
@ -68,7 +74,11 @@ void PlayerProfile::add_class_profile(Ref<ClassProfile> profile) {
|
||||
|
||||
void PlayerProfile::clear_class_profiles() {
|
||||
for (int i = 0; i < _class_profiles.size(); ++i) {
|
||||
#if VERSION_MAJOR < 4
|
||||
_class_profiles.get(i)->disconnect("changed", this, "_on_class_profile_changed");
|
||||
#else
|
||||
_class_profiles.get(i)->disconnect("changed", callable_mp(this, &PlayerProfile::_on_class_profile_changed));
|
||||
#endif
|
||||
}
|
||||
|
||||
_class_profiles.clear();
|
||||
@ -77,7 +87,13 @@ void PlayerProfile::clear_class_profiles() {
|
||||
}
|
||||
|
||||
void PlayerProfile::remove_class_profile(const int index) {
|
||||
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
_class_profiles.get(index)->disconnect("changed", this, "_on_class_profile_changed");
|
||||
#else
|
||||
_class_profiles.get(index)->disconnect("changed", callable_mp(this, &PlayerProfile::_on_class_profile_changed));
|
||||
#endif
|
||||
|
||||
_class_profiles.remove(index);
|
||||
|
||||
@ -98,7 +114,12 @@ Ref<ClassProfile> PlayerProfile::get_class_profile(const int class_id) {
|
||||
Ref<ClassProfile> class_profile = Ref<ClassProfile>(memnew(ClassProfile(class_id)));
|
||||
|
||||
class_profile->load_defaults();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
class_profile->connect("changed", this, "_on_class_profile_changed");
|
||||
#else
|
||||
class_profile->connect("changed", callable_mp(this, &PlayerProfile::_on_class_profile_changed));
|
||||
#endif
|
||||
|
||||
_class_profiles.push_back(Ref<ClassProfile>(class_profile));
|
||||
|
||||
@ -155,7 +176,12 @@ void PlayerProfile::from_dict(const Dictionary &dict) {
|
||||
c.instance();
|
||||
|
||||
c->from_dict(arr.get(i));
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
c->connect("changed", this, "_on_class_profile_changed");
|
||||
#else
|
||||
c->connect("changed", callable_mp(this, &PlayerProfile::_on_class_profile_changed));
|
||||
#endif
|
||||
|
||||
_class_profiles.push_back(c);
|
||||
}
|
||||
@ -187,7 +213,12 @@ void PlayerProfile::load_defaults() {
|
||||
|
||||
for (int i = 0; i < _class_profiles.size(); ++i) {
|
||||
_class_profiles.get(i)->load_defaults();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
_class_profiles.get(i)->connect("changed", this, "_on_class_profile_changed");
|
||||
#else
|
||||
_class_profiles.get(i)->connect("changed", callable_mp(this, &PlayerProfile::_on_class_profile_changed));
|
||||
#endif
|
||||
}
|
||||
|
||||
emit_change();
|
||||
|
@ -23,7 +23,15 @@ SOFTWARE.
|
||||
#ifndef SPELL_PROJECTILE_3D
|
||||
#define SPELL_PROJECTILE_3D
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
#include "scene/3d/spatial.h"
|
||||
#else
|
||||
#include "scene/3d/node_3d.h"
|
||||
|
||||
typedef class Node3D Spatial;
|
||||
#endif
|
||||
|
||||
class SpellCastInfo;
|
||||
|
||||
|
@ -450,6 +450,7 @@ void EntityDataManager::load_xp_data() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(_xp_data_path, "XPData");
|
||||
|
||||
ERR_FAIL_COND(!resl.is_valid());
|
||||
@ -457,6 +458,9 @@ void EntityDataManager::load_xp_data() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(_xp_data_path, "XPData");
|
||||
#endif
|
||||
|
||||
ERR_FAIL_COND(!s.is_valid());
|
||||
|
||||
@ -489,6 +493,7 @@ void EntityDataManager::load_entity_resources() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "EntityResourceData");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -496,6 +501,9 @@ void EntityDataManager::load_entity_resources() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "EntityResourceData");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
@ -533,6 +541,7 @@ void EntityDataManager::load_entity_skills() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "EntitySkillData");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -540,6 +549,9 @@ void EntityDataManager::load_entity_skills() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "EntitySkillData");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
@ -577,6 +589,7 @@ void EntityDataManager::load_spells() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "Spell");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -584,6 +597,9 @@ void EntityDataManager::load_spells() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "Spell");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
@ -621,6 +637,7 @@ void EntityDataManager::load_auras() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "Aura");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -628,6 +645,9 @@ void EntityDataManager::load_auras() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "Aura");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
@ -665,6 +685,7 @@ void EntityDataManager::load_characters() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "EntityData");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -672,6 +693,9 @@ void EntityDataManager::load_characters() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "EntityData");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
@ -709,6 +733,7 @@ void EntityDataManager::load_craft_datas() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "CraftRecipe");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -716,6 +741,9 @@ void EntityDataManager::load_craft_datas() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "CraftRecipe");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
@ -753,6 +781,7 @@ void EntityDataManager::load_item_templates() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "ItemTemplate");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -760,6 +789,9 @@ void EntityDataManager::load_item_templates() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "ItemTemplate");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
@ -797,6 +829,7 @@ void EntityDataManager::load_mob_datas() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "EntityData");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -804,6 +837,9 @@ void EntityDataManager::load_mob_datas() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "EntityData");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
@ -841,6 +877,7 @@ void EntityDataManager::load_player_character_datas() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "EntityData");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -848,7 +885,10 @@ void EntityDataManager::load_player_character_datas() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "EntityData");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
Ref<EntityData> pcd = s;
|
||||
@ -885,6 +925,7 @@ void EntityDataManager::load_entity_species_datas() {
|
||||
|
||||
_ResourceLoader *rl = _ResourceLoader::get_singleton();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<ResourceInteractiveLoader> resl = rl->load_interactive(path, "EntitySpeciesData");
|
||||
|
||||
ERR_CONTINUE(!resl.is_valid());
|
||||
@ -892,6 +933,9 @@ void EntityDataManager::load_entity_species_datas() {
|
||||
resl->wait();
|
||||
|
||||
Ref<Resource> s = resl->get_resource();
|
||||
#else
|
||||
Ref<Resource> s = rl->load(path, "EntitySpeciesData");
|
||||
#endif
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
|
@ -25,6 +25,8 @@ SOFTWARE.
|
||||
#include "core/os/file_access.h"
|
||||
#include "core/project_settings.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
ProfileManager *ProfileManager::_instance;
|
||||
|
||||
ProfileManager *ProfileManager::get_instance() {
|
||||
@ -164,9 +166,15 @@ void ProfileManager::from_dict(const Dictionary &dict) {
|
||||
|
||||
clears_player_profiles();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
_c_player_profile->disconnect("changed", this, "_on_player_profile_changed");
|
||||
_c_player_profile->from_dict(dict.get("cplayer_profile", Dictionary()));
|
||||
_c_player_profile->connect("changed", this, "_on_player_profile_changed");
|
||||
#else
|
||||
_c_player_profile->disconnect("changed", callable_mp(this, &ProfileManager::_on_player_profile_changed));
|
||||
_c_player_profile->from_dict(dict.get("cplayer_profile", Dictionary()));
|
||||
_c_player_profile->connect("changed", callable_mp(this, &ProfileManager::_on_player_profile_changed));
|
||||
#endif
|
||||
|
||||
Array arr = dict.get("splayer_profiles", Array());
|
||||
|
||||
@ -175,7 +183,12 @@ void ProfileManager::from_dict(const Dictionary &dict) {
|
||||
c.instance();
|
||||
|
||||
c->from_dict(arr.get(i));
|
||||
c->connect("changed", this, "_on_class_profile_changed");
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
c->connect("changed", this, "_on_player_profile_changed");
|
||||
#else
|
||||
c->connect("changed", callable_mp(this, &ProfileManager::_on_player_profile_changed));
|
||||
#endif
|
||||
|
||||
_s_player_profiles.push_back(c);
|
||||
}
|
||||
@ -189,7 +202,12 @@ ProfileManager::ProfileManager() {
|
||||
_save_file = GLOBAL_DEF("ess/profiles/save_file", "user://profile.save");
|
||||
|
||||
_c_player_profile.instance();
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
_c_player_profile->connect("changed", this, "_on_player_profile_changed");
|
||||
#else
|
||||
_c_player_profile->connect("changed", callable_mp(this, &ProfileManager::_on_player_profile_changed));
|
||||
#endif
|
||||
|
||||
if (_automatic_load)
|
||||
call_deferred("load");
|
||||
@ -197,8 +215,12 @@ ProfileManager::ProfileManager() {
|
||||
|
||||
ProfileManager::~ProfileManager() {
|
||||
_instance = NULL;
|
||||
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
_c_player_profile->disconnect("changed", this, "_on_player_profile_changed");
|
||||
#else
|
||||
_c_player_profile->disconnect("changed", callable_mp(this, &ProfileManager::_on_player_profile_changed));
|
||||
#endif
|
||||
|
||||
_s_player_profiles.clear();
|
||||
}
|
||||
|
@ -24,6 +24,21 @@ SOFTWARE.
|
||||
|
||||
#include "../data/items/item_visual.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
#include "servers/rendering_server.h"
|
||||
|
||||
typedef class RenderingServer VisualServer;
|
||||
typedef class RenderingServer VS;
|
||||
|
||||
#define PoolVector3Array PackedVector3Array
|
||||
#define PoolVector2Array PackedVector2Array
|
||||
#define PoolColorArray PackedColorArray
|
||||
#define PoolIntArray PackedInt32Array
|
||||
#define PoolRealArray PackedFloat32Array
|
||||
#endif
|
||||
|
||||
EntityEnums::EntityGender CharacterSkeleton3D::get_gender() {
|
||||
return _gender;
|
||||
}
|
||||
@ -325,7 +340,9 @@ Array CharacterSkeleton3D::bake_mesh_array_uv(Array arr, Ref<Texture> tex, float
|
||||
PoolVector2Array uvs = arr[VisualServer::ARRAY_TEX_UV];
|
||||
PoolColorArray colors = arr[VisualServer::ARRAY_COLOR];
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
img->lock();
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < uvs.size(); ++i) {
|
||||
Vector2 uv = uvs[i];
|
||||
@ -336,7 +353,9 @@ Array CharacterSkeleton3D::bake_mesh_array_uv(Array arr, Ref<Texture> tex, float
|
||||
colors.set(i, colors[i] * c * mul_color);
|
||||
}
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
img->unlock();
|
||||
#endif
|
||||
|
||||
arr[VisualServer::ARRAY_COLOR] = colors;
|
||||
|
||||
|
@ -37,6 +37,16 @@ SOFTWARE.
|
||||
|
||||
#include "../data/items/item_visual_entry.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
#include "scene/3d/spatial.h"
|
||||
#else
|
||||
#include "scene/3d/node_3d.h"
|
||||
#define Spatial Node3D
|
||||
#define Texture Texture2D
|
||||
#endif
|
||||
|
||||
class ItemVisual;
|
||||
|
||||
//Rename to HumanoidCharSkeleton -> maybe make that a subclass?
|
||||
|
@ -22,6 +22,12 @@ SOFTWARE.
|
||||
|
||||
#include "category_cooldown.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
#define REAL FLOAT
|
||||
#endif
|
||||
|
||||
int CategoryCooldown::get_category_id() const {
|
||||
return _category_id;
|
||||
}
|
||||
|
@ -22,6 +22,12 @@ SOFTWARE.
|
||||
|
||||
#include "cooldown.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
#define REAL FLOAT
|
||||
#endif
|
||||
|
||||
int Cooldown::get_spell_id() const {
|
||||
return _spell_id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user