1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00

Merge branch 'fix_crash_ai' into 'master'

Fix a crash in aipackage.cpp

Closes #5966

See merge request OpenMW/openmw!848
This commit is contained in:
Petr Mikheev 2021-05-13 13:07:20 +00:00
commit b0c9f6167c

View File

@ -15,7 +15,12 @@ namespace ESM
{
AIPackage pack;
if (esm.retSubName() == AI_CNDT) {
if (mList.empty())
{
esm.fail("AIPackge with an AI_CNDT applying to no cell.");
} else {
mList.back().mCellName = esm.getHString();
}
} else if (esm.retSubName() == AI_Wander) {
pack.mType = AI_Wander;
esm.getHExact(&pack.mWander, 14);