mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
Don't crash if stat_data is not set.
This commit is contained in:
parent
aa7e605d65
commit
3bbe113897
@ -707,8 +707,12 @@ void Entity::_setup() {
|
|||||||
|
|
||||||
ERR_FAIL_COND(!cc.is_valid());
|
ERR_FAIL_COND(!cc.is_valid());
|
||||||
|
|
||||||
|
Ref<StatData> stat_data = cc->get_stat_data();
|
||||||
|
|
||||||
|
ERR_FAIL_COND(!stat_data.is_valid());
|
||||||
|
|
||||||
for (int i = 0; i < ESS::get_singleton()->stat_get_count(); ++i) {
|
for (int i = 0; i < ESS::get_singleton()->stat_get_count(); ++i) {
|
||||||
stat_set_base(i, cc->get_stat_data()->get_base(i));
|
stat_set_base(i, stat_data->get_base(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ESS::get_singleton()->stat_get_count(); ++i) {
|
for (int i = 0; i < ESS::get_singleton()->stat_get_count(); ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user