diff options
author | ihm-tswow <76849026+ihm-tswow@users.noreply.github.com> | 2022-08-03 09:24:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 09:24:05 +0200 |
commit | bac3eda135741f79d22270d0cb0ce38f9f32d423 (patch) | |
tree | 31d64672774af0956f91e22bd5c4b9383f15001c | |
parent | 2ad36c37b430694dfa61f43fb7c135037423bdb2 (diff) |
Core/Misc: Improve missing class health/mana data error message during startup (#28173)
- If the class lacks health/mana data entirely, pClassInfo is null and crashes without reaching the error message if we don't check it first.
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index ec69ece5bc5..a7ba9650d1c 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4352,7 +4352,7 @@ void ObjectMgr::LoadPlayerInfo() auto& pClassInfo = _playerClassInfo[class_]; // fatal error if no level 1 data - if (!pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0) + if (!pClassInfo || !pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0) { TC_LOG_ERROR("sql.sql", "Class %i Level 1 does not have health/mana data!", class_); ABORT(); |