mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-27 06:07:14 +01:00
Check it the ESS singleton is null in LevelStatData's constructor.
This commit is contained in:
parent
d34ba0a7f4
commit
31e29ebd71
@ -48,6 +48,7 @@ int ComplexLevelStatData::_get_stat_diff(int main_stat, int old_level, int new_l
|
||||
}
|
||||
|
||||
ComplexLevelStatData::ComplexLevelStatData() {
|
||||
if (ESS::get_singleton()->get_max_character_level()) {
|
||||
_stat_per_level.resize(ESS::get_singleton()->get_max_character_level());
|
||||
|
||||
int msc = ESS::get_singleton()->stat_get_main_stat_count();
|
||||
@ -60,6 +61,7 @@ ComplexLevelStatData::ComplexLevelStatData() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ComplexLevelStatData::~ComplexLevelStatData() {
|
||||
for (int i = 0; i < ESS::get_singleton()->get_max_character_level(); ++i) {
|
||||
|
@ -46,7 +46,9 @@ int SimpleLevelStatData::_get_stat_diff(int main_stat, int old_level, int new_le
|
||||
}
|
||||
|
||||
SimpleLevelStatData::SimpleLevelStatData() {
|
||||
if (ESS::get_singleton()) {
|
||||
_stat_per_level.resize(ESS::get_singleton()->stat_get_main_stat_count());
|
||||
}
|
||||
|
||||
for (int i = 0; i < _stat_per_level.size(); ++i) {
|
||||
_stat_per_level.set(i, 0);
|
||||
|
@ -90,7 +90,9 @@ void StatData::set_mod_stat_multiplier(int index, float value) {
|
||||
|
||||
StatData::StatData() {
|
||||
//TODO remove? let properties handle this?
|
||||
if (ESS::get_singleton()) {
|
||||
_entries.resize(ESS::get_singleton()->stat_get_count());
|
||||
}
|
||||
|
||||
for (int i = 0; i < _entries.size(); ++i) {
|
||||
_entries.set(i, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user