diff --git a/data/data_manager.cpp b/data/data_manager.cpp index c8760db..7b663f0 100644 --- a/data/data_manager.cpp +++ b/data/data_manager.cpp @@ -176,11 +176,7 @@ void DataManager::load_spells() { ERR_CONTINUE(!s.is_valid()); - Resource *r = (*s); - - Spell *sp = cast_to(r); - - Ref spell = Ref(sp); + Ref spell = s; ERR_CONTINUE(!spell.is_valid()); @@ -219,11 +215,7 @@ void DataManager::load_auras() { ERR_CONTINUE(!s.is_valid()); - Resource *r = (*s); - - Aura *a = cast_to(r); - - Ref aura = Ref(a); + Ref aura = s; ERR_CONTINUE(!aura.is_valid()); @@ -262,11 +254,7 @@ void DataManager::load_characters() { ERR_CONTINUE(!s.is_valid()); - Resource *r = (*s); - - CharacterClass *cc = cast_to(r); - - Ref cls = Ref(cc); + Ref cls = s; ERR_CONTINUE(!cls.is_valid()); @@ -305,11 +293,7 @@ void DataManager::load_craft_datas() { ERR_CONTINUE(!s.is_valid()); - Resource *r = (*s); - - CraftDataAttribute *cc = cast_to(r); - - Ref cda = Ref(cc); + Ref cda = s; ERR_CONTINUE(!cda.is_valid()); @@ -348,11 +332,7 @@ void DataManager::load_item_templates() { ERR_CONTINUE(!s.is_valid()); - Resource *r = (*s); - - ItemTemplate *cc = cast_to(r); - - Ref it = Ref(cc); + Ref it = s; ERR_CONTINUE(!it.is_valid()); diff --git a/entities/entity.h b/entities/entity.h index 8edeedd..cbdb27e 100644 --- a/entities/entity.h +++ b/entities/entity.h @@ -1,6 +1,13 @@ #ifndef ENTITY_H #define ENTITY_H +#ifdef ENTITIES_2D +#include "scene/2d/physics_body_2d.h" +#else +#include "scene/3d/physics_body.h" +#endif + + #include "../data/character.h" #include "../data/craft_data_attribute.h" #include "../data/spell.h" @@ -12,7 +19,7 @@ #include "../inventory/bag_slot.h" #include "../data/item_instance.h" #include "player_talent.h" -#include "scene/2d/physics_body_2d.h" + #include "../data/spell.h" #include "stats/stat.h"