mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
Small fixes.
This commit is contained in:
parent
18afb79b58
commit
9e976eaebf
@ -1217,12 +1217,7 @@ void Entity::set_stat_int(int index, Ref<Stat> entry) {
|
||||
}
|
||||
|
||||
Ref<Stat> Entity::get_stat_enum(Stat::StatId stat_id) {
|
||||
//ERR_FAIL_COND_V(stat_id == Stat::STAT_ID_NONE);
|
||||
|
||||
if (stat_id == Stat::STAT_ID_NONE) {
|
||||
print_error("Add fail cond here, stat has STAT_ID_NONE!");
|
||||
return _stats[0];
|
||||
}
|
||||
ERR_FAIL_INDEX_V(stat_id, Stat::STAT_ID_TOTAL_STATS, Ref<Stat>());
|
||||
|
||||
return _stats[stat_id];
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ void Stat::remove_modifier_index(int index) {
|
||||
}
|
||||
|
||||
void Stat::apply_modifiers() {
|
||||
ERR_FAIL_COND(_owner == NULL);
|
||||
ERR_FAIL_COND(!ObjectDB::instance_validate(_owner));
|
||||
ERR_FAIL_COND(!_stat_data_entry.is_valid());
|
||||
|
||||
reset_values();
|
||||
|
@ -111,6 +111,7 @@ StatDataEntry::StatDataEntry() {
|
||||
_modifier_apply_type = Stat::MODIFIER_APPLY_TYPE_STANDARD;
|
||||
|
||||
for (int i = 0; i < MAX_MOD_STATS; ++i) {
|
||||
_mod_stats[i].stat_id = Stat::STAT_ID_HEALTH;
|
||||
_mod_stats[i].max_value = 1000;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user