mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-26 13:47:12 +01:00
Check it the ESS singleton is null in LevelStatData's constructor.
This commit is contained in:
parent
d34ba0a7f4
commit
31e29ebd71
@ -48,15 +48,17 @@ int ComplexLevelStatData::_get_stat_diff(int main_stat, int old_level, int new_l
|
||||
}
|
||||
|
||||
ComplexLevelStatData::ComplexLevelStatData() {
|
||||
_stat_per_level.resize(ESS::get_singleton()->get_max_character_level());
|
||||
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();
|
||||
int msc = ESS::get_singleton()->stat_get_main_stat_count();
|
||||
|
||||
for (int i = 0; i < ESS::get_singleton()->get_max_character_level(); ++i) {
|
||||
_stat_per_level.write[i].resize(msc);
|
||||
for (int i = 0; i < ESS::get_singleton()->get_max_character_level(); ++i) {
|
||||
_stat_per_level.write[i].resize(msc);
|
||||
|
||||
for (int j = 0; j < msc; ++j) {
|
||||
_stat_per_level.write[i].set(j, 0);
|
||||
for (int j = 0; j < msc; ++j) {
|
||||
_stat_per_level.write[i].set(j, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,9 @@ int SimpleLevelStatData::_get_stat_diff(int main_stat, int old_level, int new_le
|
||||
}
|
||||
|
||||
SimpleLevelStatData::SimpleLevelStatData() {
|
||||
_stat_per_level.resize(ESS::get_singleton()->stat_get_main_stat_count());
|
||||
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?
|
||||
_entries.resize(ESS::get_singleton()->stat_get_count());
|
||||
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