mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
Better way to cast refs at load.
This commit is contained in:
parent
adc47a4ae7
commit
565993fdb8
@ -176,11 +176,7 @@ void DataManager::load_spells() {
|
||||
|
||||
ERR_CONTINUE(!s.is_valid());
|
||||
|
||||
Resource *r = (*s);
|
||||
|
||||
Spell *sp = cast_to<Spell>(r);
|
||||
|
||||
Ref<Spell> spell = Ref<Spell>(sp);
|
||||
Ref<Spell> 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<Aura>(r);
|
||||
|
||||
Ref<Aura> aura = Ref<Aura>(a);
|
||||
Ref<Aura> 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<CharacterClass>(r);
|
||||
|
||||
Ref<CharacterClass> cls = Ref<CharacterClass>(cc);
|
||||
Ref<CharacterClass> 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<CraftDataAttribute>(r);
|
||||
|
||||
Ref<CraftDataAttribute> cda = Ref<CraftDataAttribute>(cc);
|
||||
Ref<CraftDataAttribute> 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<ItemTemplate>(r);
|
||||
|
||||
Ref<ItemTemplate> it = Ref<ItemTemplate>(cc);
|
||||
Ref<ItemTemplate> it = s;
|
||||
|
||||
ERR_CONTINUE(!it.is_valid());
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user